tags:

views:

44

answers:

1

i have time of the day in seconds and i have to find the utc time since 1970, is there any api which can directly convert this time to utc time,

i m using ansi c , and working on windows platform platform independent api will be preferred

thanx in advance.

A: 

You can fill in a tm struct with the time of day you have (you'd have to convert it into seconds/minutes/hours) and the date. Then convert it with mktime() in time.h.

philippe
i have done so and find the required results but i need some standard method to do so some sort of api,,,
moon
@moon mktime() is standard (ANSI and POSIX) so I'm not sure why you "need some standard method". I'm afraid you'll have to write it yourself, or perhaps you can find a library that does that.
philippe