Re: time zone problems

2009-03-30 Thread Erez D
thanks On Sun, Mar 29, 2009 at 8:22 PM, Oron Peled wrote: > (oops, the mailing list wasn't addressed in previous copy). > > Erez: > > struct tm time_str; > > ... > > int d=timegm(&time_str)-timelocal(&time_str); > > printf("%d\n",d); > > > > > > prints 7200 (which is 2*3600 -> two hours). > > >

Re: time zone problems

2009-03-29 Thread Oron Peled
(oops, the mailing list wasn't addressed in previous copy). Erez: > struct tm time_str; > ... > int d=timegm(&time_str)-timelocal(&time_str); > printf("%d\n",d); > > > prints 7200 (which is 2*3600 -> two hours). > > > any idea ? > or in in other words, how the f...@#k i get the offset from GMT

Re: time zone problems

2009-03-29 Thread geoffrey mendelson
On Mar 29, 2009, at 3:24 PM, e2xbegqsdyt21hfc wrote: oesn't stdc dated before DT was invented? I can only suggest gnu/doc or googe for extensions or other libs. I knew that C was a relatively "old" language, but I did not know it predated Benjamin Franklin. All those years I was programmin

Re: time zone problems

2009-03-29 Thread e2xbegqsdyt21hfc
--- On Sun, 3/29/09, Erez D wrote: > i am 3 hours from GMT (as expected for israel daylight > saving) > > > however: > > struct tm time_str; > ... > int d=timegm(&time_str)-timelocal(&time_str); > printf("%d\n",d); > > > > prints 7200 (which is 2*3600 -> two hours). > > > any idea ? > or

time zone problems

2009-03-29 Thread Erez D
hi e...@new53:~$ date Sun Mar 29 11:14:50 IDT 2009 e...@new53:~$ date -d "GMT" Sun Mar 29 03:00:00 IDT 2009 e...@new53:~$ date -d "IDT" Sun Mar 29 00:00:00 IDT 2009 so i am 3 hours from GMT (as expected for israel daylight saving) however: struct tm time_str; ... int d=timegm(&time_str)-timelo