H
Huey
Hi All,
I need to compute the current time value in seconds: the current time
is 12/16/2003, and it's time value in integer should around 1071560616
seconds since 1/1/1970. It is easy to get such a value in Tcl, but i
noticed it is uneasy to do in C. Well, ANSI provides functions such as
time(), asctime(), localtime(), gmtime(), ctime() in time.h file. But,
I can't convert the returns into integer in seconds.
I did think of the way as computing by:
year*365 + month * 12 + day *24 + .....
with the values derived from struct tm members. but I can't handle
the leap year and leap month well. Anybody can help? Thanks!
Huey
I need to compute the current time value in seconds: the current time
is 12/16/2003, and it's time value in integer should around 1071560616
seconds since 1/1/1970. It is easy to get such a value in Tcl, but i
noticed it is uneasy to do in C. Well, ANSI provides functions such as
time(), asctime(), localtime(), gmtime(), ctime() in time.h file. But,
I can't convert the returns into integer in seconds.
I did think of the way as computing by:
year*365 + month * 12 + day *24 + .....
with the values derived from struct tm members. but I can't handle
the leap year and leap month well. Anybody can help? Thanks!
Huey