[uClinux-dev] Setting the timezone

fred basset fredbasset1000 at gmail.com
Sun Jul 1 17:48:52 EDT 2012


Hi Guys,

I'm having trouble with getting the local timezone correct.  I have
stored the timezone in verified correct format (e.g. PST8).  I have an
rc.default script which is run as run as part of the startup process,
and it exports TZ as PST8.

I've verified the variable is being set correctly by running "set" after boot:

# set
TZ=PST8

PS2=>
PS1=#
IFS=

USER=root
SHELL=/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
TERM=vt102
HOME=/
#

However, when I run the "date" command I get back:

Sun Jul  1 21:46:25 UTC 2012

which is the time right now in UTC, so it looks like it's ignoring TZ.
 Am I doing something wrong by exporting TZ in my startup script?
What is the preferred way of setting the timezone?  We're using ucLibc
too.

Thanks,
Fred



More information about the uClinux-dev mailing list