reverse asctime()? EEEK!
Dieter Muller
dworkin at Solbourne.COM
Thu Jun 22 14:17:22 AEST 1989
In article <5178 at b11.ingr.com> abashian at b11.ingr.com (Pete Abashian) writes:
>Now the problem. I need to be able to take an ascii string and
>convert it back to the internal storage - number of seconds since epoch.
>
>The task would normally entail some simple mathematics to incorporate leap
>[gag] years, etc... But what about the sticky user(s) that want to be
>able to input virtually any valid combination of dates/times? 12MAY89,
>12-MAY-89, May 12, 1989....etc. For the life of me I cannot remember EVER
>seeing an include file or archive with a reference to such a routine.
You might be interested in the CCMD library from Columbia University.
It's ``An Implementation of the TOPS-20 COMND Jsys in C''. Among many
other things, it has a very nice date parser. I just tried all the forms
you listed, and they all worked.
The code is public domain (commercial rights reserved) and currently
runs on BSD, SysV, Ultrix, and MS-DOS systems. It was written by
Andrew Lowry and Howard Kaye at Columbia University. I know they're
on the net, but I can't find an actual account name anywhere in the
code.
If you have Internet access, you can ftp it from cunixc.columbia.edu.
Dieter
--
Welcome to the island. You are number six.
boulder!stan!dworkin
dworkin%stan at boulder.colorado.edu
dworkin at solbourne.com
More information about the Comp.lang.c
mailing list