Re: [SLUG] RFC: Gradebook Project Database

From: Ronan Heffernan (ronan@iotcorp.com)
Date: Wed Oct 16 2002 - 08:34:44 EDT


> You may find this to be a minor issue. But as long as you are recording the
> date in any field, you may well come to a point where you wish to sort on
> that date field. And when that happens, you will wish you had followed the
> ISO standard on how to write the date, which is YYYYMMDD, thus your dates
> in the example would be 19890323 and 19890214. This will give an unambiguous
> sort even across century boundaries; years, then months, then days. In
> additon it resolves the ambiguity between European and US format (is it
> April 7 or 7 April) which some in Europe try to 'fix' by calling it 7 IV
> w_h_i_c_h of
> course doesn't work in an all-numerical date field. Bob F
>

Paul,
    The SQL standard calls for several kinds of date field (date,
datetime, timestamp), and PostgreSQL supports all of these. The dates
are stored in a binary structure, not in a text field, and all SQL
queries that call for an "order by" sort on the date field will be
sorted correctly. You can even specify an environment variable that
controls how the dates will be displayed, but the formatting that you
choose will have no impact on the sort-order for the date fields.

--ronan



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:16:49 EDT