[comp.lang.c] From

root@libove.UUCP (Jay M. Libove) (10/22/88)

Well, there are wonderful functions standard with C for getting the
system date in long int (time_t) format, and for converting it to a
pretty structure (struct tm) with all the pieces broken out... but
there is no way I know of to fill in such a structure and make a
time_t out of it... e.g. for System V "touch" which allows a date
argument to be given.

Does anyone have the code for this (struct tm) to (time_t) conversion?

Thanks!

-- 
Jay Libove		ARPA:	jl42@andrew.cmu.edu or libove@cs.cmu.edu
5731 Centre Ave, Apt 3	BITnet:	jl42@andrew or jl42@drycas
Pittsburgh, PA 15206	UUCP:	uunet!nfsun!libove!libove or
(412) 362-8983		UUCP:	psuvax1!pitt!darth!libove!libove

wu@spot.Colorado.EDU (WU SHI-KUEI) (10/24/88)

In article <182@libove.UUCP> root@libove.UUCP (Jay M. Libove) writes:
>.............................................................. but
>there is no way I know of to fill in such a structure and make a
>time_t out of it... e.g. for System V "touch" which allows a date
>argument to be given.
>
>Does anyone have the code for this (struct tm) to (time_t) conversion?

See page 50ff in Marc Rochkind's Advanced UNIX Programming.

Just a guest here. In real life:
Carl Brandauer
uunet!nbires!bdaemon!carl