[afnog] timezone on Solaris 9

Alan Barrett apb at cequrux.com
Fri Jan 27 20:55:17 EAT 2006


This is not an xntp issue, it's a timezone issue,
so I changed the subject.

On Fri, 27 Jan 2006, sematin at mtn.co.ug wrote:
> Possibly. The time I am seeing is 6 hours behind my time.
> What puzzles me is that running date shows:
> Fri Jan 27 13:28:20 GMT 2006
> 
> Which is 6 hours behind me.

I suspect that the "GMT" above is not your timezone,
but is the first three letters of the TZ environment
variable.

> > > TZ=Africa/Kampala
> > 
> > That may not be right for Solaris. In any case, using the 
> > environment to set the zone is risky, as environments can get 
> > modified or flushed. I use /etc/localtime on BSD boxes, but I 
> > don't know the Solaris equivalent off-hand.

Brian's advice is good.  Use the "env" or "set" command to check whether
that environment setting really had any effect, and RTFM to find if
there's a better place to set the default timezone.

> I got this setting by looking through /usr/share/lib/zoneinfo and I also
> tried setting it to GMT+3 but got the same problems.

The traditional unix meaning of TZ=GMT+3 is "The name of my timezone
is 'GMT', and my timezone is 3 hours behind GMT/UTC, and there is no
daylight savings time."  You probaby want something more like TZ=EAT-3
if you have a traditional SYSV-style timezone implementation, or
TZ=Africa/Kampala if you have a modern timezone implementation.

--apb (Alan Barrett)



More information about the afnog mailing list