Newsgroups: sci.lang
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!europa.clark.net!newsfeeds.sol.net!hammer.uoregon.edu!zephyr.texoma.net!uunet!in2.uu.net!198.53.146.23!acli.interlog.com!acli
From: acli@acli.interlog.com (Ambrose Li)
Subject: Re: Wierd U.S. Date Order : M,D,Y
Organization: somewhere in Scarborough, Canada running C News CR.E and some assorted hacks for NNTP (including a hacked nntpxmit derived from NNTP 1.5.12)
Message-ID: <E6Cq8J.GMK@acli.interlog.com>
References: <E61zF8.DFA@cix.compulink.co.uk> <3310BDFC.570A@scruznet.com> <E666zI.CI6@fsa.bris.ac.uk> <Pine.HPP.3.91.970225161624.15121A-100000@msuacad.morehead-st.edu>
Date: Sat, 1 Mar 1997 06:33:55 GMT
Lines: 27

On Tue, 25 Feb 1997 16:18:48 -0500, in article <Pine.HPP.3.91.970225161624.15121A-100000@msuacad.morehead-st.edu>, Michael Slone  <mpslon01@morehead-st.edu> wrote:
>> Mike Wright (darwin@scruznet.com) wrote:
>> 
>> Only as long as you write 97/01/01 etc, otherwise 97/10/10 will come
>> before 97/7/7. Anyone yet seen a computer which will sort "7 " (note the
>> intentional space) before "10"? 

I have seen that. Depending on which programming language you use, it
might even be easy to do. For example, in Perl,

   sub numerically { $a < $b }

will provide you with the necessary function to make the "sort" operator
sort "7 " before "10". A little bit more coding will provide the function
to sort "97/7/7" after "97/01/01".

>How about of the form YYYY/MM/DD, eg 1997/02/24? It would be easy enough 
>to instruct the computer to prepend 0s to one-digit MM or DD. This would 
>keep 1997/07/07 sorted before 1997/10/10.

Incidentally, this (YYYYMMDD) is exactly how dBASE and its derivatives
store dates internally. Why they did that is obviously for the ease of
sorting.

-- 
Ambrose Li   ~   @interlog.com:acli@acli   (Hello, world!\n)
~   http://www.interlog.com/~acli/~acli/   ~   print flush quit
