Problem with setting timezone in shell

Thomas freebsdlists at bsdunix.ch
Wed Feb 16 09:49:26 UTC 2011


Hello

Maybe someone can explain this. My localtime zone is Europe/Zurich (same
as Berlin, Madrid, it's CET).

IMHO this is an equivalent of UTC+1

Lets try this on my shell. The Systemclock is set to UTC:
thomas at bert:~> date
Wed Feb 16 09:12:00 UTC 2011

Set localtime:
thomas at bert:~> setenv TZ 'Europe/Zurich'
thomas at bert:~> date
Wed Feb 16 10:12:43 CET 2011 <- Correct, my localtime

Now set it back to UTC:
thomas at bert:~> setenv TZ 'UTC'
thomas at bert:~> date
Wed Feb 16 09:13:04 UTC 2011

Let's try setting my localtime with UTC+1:
thomas at bert:~> setenv TZ 'UTC+1'
thomas at bert:~> date
Wed Feb 16 08:13:23 UTC 2011 <- It's wrong.
The time went back for 1 hour instead of adding 1 hour.

Removing one hour works:
thomas at bert:~> setenv TZ 'UTC-1'
thomas at bert:~> date
Wed Feb 16 10:14:11 UTC 2011 <- correct time.

But thats not correct. I never had problems with UTC+1 settings in other
programs like db, php, irssi ...)

My System:
FreeBSD bert.mlan.solnet.ch 8.2-RC3 FreeBSD 8.2-RC3 #0: Sun Jan 30
06:28:31 UTC 2011
root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

tcsh default shell with not setting.

Regards,
Thomas Vogt


More information about the freebsd-questions mailing list