need "yy-ddd-hh:mm:ss ==> (time_t) clock" converter

Eoin Woods ewoods at hemel.bull.co.uk
Fri Jan 25 19:16:18 AEST 1991


lgdelta!email!tachost!BRL.MIL!Info-Unix-Request at tachost.af.mil (The Moderator) writes:

>Help!  I need something to convert yy-ddd-hh:mm:ss (i.e. year,
>day_of_year, hour, minute, second) to a unix-style
>_number_of_seconds_since_00:00:00_GMT,_Jan._1,_1970_.

Take a look at the book 

	"Advanced UNIX Programming" by Marc Rochkind
	(Prentice Hall, 1985, ISBN 0-13-011818-[41])

He discusses UNIX's handling of dates and times in section 3.4 and presents
a function timecvt() that takes a string of the form YYMMDDhhmmss and converts
it to "seconds since the epoch" form (page 50-52). (Its a generally "classic"
book anyway!)

Eoin.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~    Eoin Woods, Software Development Group, Bull HN Information Systems,   ~
~                Maxted Road, Hemel Hempstead, Herts HP2 7DZ, UK.           ~
~                Tel : +44 442 232222 x4823   Fax : +44 442 234084          ~
~      < Eoin.Woods at hemel.bull.co.uk  or   ...!uunet!ukc!brno!ewoods>       ~
~          < When do we start news group comp.os.emacs ?  :-) >             ~



More information about the Comp.unix.questions mailing list