i have tried all the above functions...but what i need is to print the current time in the undermentioned format:Tue Jan 08 2008 22:25:22 GMT+0530 (India Standard Time)

i am able to print everything except GMT+530 using the function strftime...
so i am looking for some variable or function which can tell me the current timezone..
and i have to find the solution only within the ANSI/C89 boundaries..the functions like localtime must be using something to chge the time from UTC to localtime..

This is the output i get..instead of the time difference in number...i get India Standard Time twice...!!

>>Wed Jan 09 2008 India Standard TimeIndia Standard Time<<

as I stated earlier ..i need GMT+0530..

for the time being what i am doing is ..subtracting the value of localtime and gmtime..
hence i get the time difference in seconds..(which comes out to be 19800 seconds in case of India) ...so i calculate number of hours from it and concatenate it to my output string...

but i still need a way out of calculating the time difference...

technosavvy

9Jan2008 10:44

Re: find timezone using C

this is something what i have tried and is now giving the right output...
still looking for an easy way out :D :)