Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!pikes!boulder!stan!dworkin From: dworkin@Solbourne.COM (Dieter Muller) Newsgroups: comp.lang.c Subject: Re: reverse asctime()? EEEK! Keywords: dates Message-ID: <1499@salgado.Solbourne.COM> Date: 22 Jun 89 04:17:22 GMT References: <5178@b11.ingr.com> <9903@dasys1.UUCP> Reply-To: dworkin@Solbourne.com (Dieter Muller) Distribution: usa Organization: Solbourne Computer Inc., Longmont, Colorado Lines: 29 In article <5178@b11.ingr.com> abashian@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@boulder.colorado.edu dworkin@solbourne.com