[lug] Date Conversion Routine

Tkil tkil at scrye.com
Mon Jun 19 20:04:44 MDT 2000


>>>>> "David" == David Morris <boru at frii.com> writes:

David> Unfortunately, we cannot control the filenames, so we have to
David> deal with both. :(

i've replied to the technical side of this in a different message.
let me step on the soapbox and evangelize the glories of the ISO-8601
date format....  or at least provide a pointer thereto:

   http://www.cl.cam.ac.uk/~mgk25/iso-time.html

you might be able to bludgeon your suppliers with "please use the ISO
standard"; it might make life easier for you.  :)

David> Anyone on the group know of a UNIX command, awk script, small C
David> program, etc. that can do this conversion?

note that using perl just for the fragment regarding to dates is
probably hideously heavyweight.  using perl for the whole system, on
the other hand, is a consideration.  (that is to say, every time i've
dealt with a big shell script that needs this kind of calculation,
the end result has been a bulk translation to perl to preserve my
sanity.)

anyway.
t.

p.s. if it's not obvious, the version of my perl solution which uses
     time_t values is only good between 1970 and 2038 or so.
     Date::Calc is good for all gregorian dates, and it will merrily
     handle julian even further back.  *shrug*




More information about the LUG mailing list