Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Convert string time into seconds? Message-ID: <2239@auspex.auspex.com> Date: 14 Jul 89 19:17:21 GMT References: <214@melpar.UUCP> <4760015@hpirs.HP.COM> <1641@zen.co.uk> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 13 >Is there an ANSI C/Posix/WhateverStandardYouCareToNominate function that will >convert from a time in a string (as produced by asctime()/ctime()) ? No, but you could snatch the "getdate" function from, among other places, the netnews source (as Steve Bellovin, author of that function, may already have noted); it uses a YACC parser to accept quite a number of time formats, and if it doesn't handle "asctime()" format you can probably whack it to do so. It currently does the equivalent of what "mktime()" does itself, but you could rewhack it to use "mktime()", at the expense of possibly eliminating its ability to parse dates with explicit time zone specifications in them.