Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpfcso!hpfinote!pnl From: pnl@hpfinote.HP.COM (Peter Lim) Newsgroups: comp.lang.c Subject: Time format conversion problem Message-ID: <15080011@hpfinote.HP.COM> Date: 6 May 90 01:08:44 GMT Organization: Hewlett Packard CICD Lines: 35 I'm having a bit of problem with time in C. Consider the following program fragment. #include struct tm the_time; long time_in_long; /* To convert time_in_long to the_time, I use .... */ the_time = localtime (&time_in_long); /* To convert the_time to time_in_long, what do I do ?? */ time_in_long = XXXXXX (&the_time); I found that in Microsoft or Zortech C, XXXXXX() is mktime(); but I need to move the program to a UNIX environment which doesn't have mktime(). So, I'm stuck. Anybody know which library function works the same as mktime(), or have some C code to replace the function ?? My UNIX manual says that time_in_long should store the value of the time in seconds from 00:00:00 January 1, 1970. If this help ? Regards, ## Life is fast enough as it is ........ Peter Lim. ## .... DON'T PUSH IT !! >>>-------, ########################################### : E-mail: plim@hpsgwg.HP.COM Snail-mail: Hewlett Packard Singapore, : Tel: (065)-279-2289 (ICDS, ICS) | Telnet: 520-2289 1150 Depot Road, __\@/__ ... also at: pnl@hpfipnl.HP.COM Singapore 0410. SPLAT !