<div dir="ltr">hi<br><br>erez@new53:~$ date<br>Sun Mar 29 11:14:50 IDT 2009<br>erez@new53:~$ date -d "GMT"<br>Sun Mar 29 03:00:00 IDT 2009<br>erez@new53:~$ date -d "IDT"<br>Sun Mar 29 00:00:00 IDT 2009<br>
<br>so i am 3 hours from GMT (as expected for israel daylight saving)<br><br><br>however:<br><br>struct tm time_str;<br>...<br>int d=timegm(&time_str)-timelocal(&time_str);<br>printf("%d\n",d);<br><br><br>
prints 7200 (which is 2*3600 -> two hours).<br><br><br>any idea ?<br>or in in other words, how the f@#k i get the offset from GMT c-code ?<br><br><br>thanks,<br>erez.<br></div>