[H-GEN] time.h

Web Express Humbug email news feed humbug at term.webexpress.net.au
Mon May 18 21:50:46 EDT 1998



---------- Forwarded message ----------
Date: Tue, 19 May 1998 11:49:09 +1000 (EST)
From: Web Express Humbug email news feed <humbug at term.webexpress.net.au>
To: chat at humbug.org.au
Subject: time.h

I know that this is probably not quite on topic but i am in a bit of a
pickle. I need to know how to use some of the procedures in the <time.h>
library. In particular i would like to know how to get from the computer
the struct tm and be able to use it. This is what i have but it isnt
compiling please help.

#include <stdio.h>
#include <time.h>

/*do i need the folowing??? */

struct tm{
	int tm_sec:
	int tm_min;
	int tm_hour;
	int tm_mday;
	int tm_mon;
	int tm_year;
	int tm_wday;
	int tm_yday;
	int tm_isdst;
};

void main()  {

struct tm *timebits;

/* i want to be able to read in GMT time into the struct...is this right?
*/

mktime(timebits);

/*i want to be able to do something like this....*/
printf("%d:%d:%d", timebits.tm_hour , timebits.tm_min, timebits.tm_sec);

}

Thanks in advance for any help.

Luke



----------------------- HUMBUG General List --------------------------------
echo "unsubscribe general" | mail majordomo at humbug.org.au # To Unsubscribe



More information about the General mailing list