Date: Sun, 23 Mar 2008 16:05:39 -0400 From: fred <fred@fullmetalpacket.com> To: freebsd-questions@freebsd.org Subject: Timezone problem Message-ID: <007d01c88d21$4440be30$ccc23a90$@com>
next in thread | raw e-mail | index | archive | help
Hello everyone, First of all, sorry for the terrible English I will do my best, also I don't have much programming knowledge only some PHP. I am having issues with a software that I run on my FreeBSD server (6.2-RELEASE). Here is a simple demonstration of the problem: This code: // CODE START #include <stdio.h> #include <time.h> int main() { extern long timezone1; tzset(); printf("timezone is %d\n", timezone); printf("tzname[0] is %s\n", tzname[0]); printf("tzname[1] is %s\n", tzname[1]); return 0; } // CODE END Give this result: timezone is 134513672 tzname[0] is EST tzname[1] is EDT The value of "timezone" should be "14400" which is the difference between my timezone (EDT) and UTC in seconds. This problem only appeared when we went from EST to EDT (daylight saving time) on march 9th. Anyone knows why I am getting "134513672" ? Here is some more information about my system: # date Sat Mar 22 15:24:42 EDT 2008 # date -u Sat Mar 22 19:24:45 UTC 2008 # gcc -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.4.6 [FreeBSD] 20060305 # uname -a FreeBSD 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 Thank for the help! -fred
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?007d01c88d21$4440be30$ccc23a90$>