Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!nosc!humu!pegasus!richard From: richard@pegasus.com (Richard Foulk) Newsgroups: comp.lang.perl Subject: Re: reverse of localtime() Message-ID: <1990Mar4.034414.25460@pegasus.com> Date: 4 Mar 90 03:44:14 GMT References: <1176@frankland-river.aaii.oz.au> Reply-To: richard@pegasus.UUCP (Richard Foulk) Organization: Pegasus, Honolulu Lines: 19 >I am writing a perl program at the moment which is doing a lot of >manipulation of dates and times. > >I am maintaining a text file which contains dates such as 24/04/89 and >to manipulate these dates easily I would like to convert that to "the >number of seconds since Jan 1970". This is the reverse of what localtime() >does. [I can't keep the number of seconds in the file rather than the >date either since the file may be modified by hand.] > >My unix manual (on SUN/OS) says there is a timelocal() function. >Is this a worthwhile addition to perl ? I can't see a simple way of >doing it in perl. I've been real tempted to stuff ctime(1) and getdate(1) from the Cnews distribution into perl. Doing things like accounting and such they are very handy, but pretty costly to invoke from perl. -- Richard Foulk richard@pegasus.com