Posix Timezone format

Louis Guindon Louis_Guindon at pmc-sierra.com
Fri Nov 14 00:48:26 UTC 2008


Hi Guy,

So, yes I am trying to make an application list of time zone and let
them select a time zone and make that the system time zone.

This application is aimed for an embedded platform where a limited set
of Linux functionalities is available. Uclibc is used on the platform
and the /etc/timezone and the whole zoneinfo directory tree are not
supported.

The feature where the POSIX time zone echoed to /tmp/TZ and the busybox
date command are working well together. But a POSIX string for the
timezone is required.

Regards,

Louis

-----Original Message-----
From: Guy Harris [mailto:guy at alum.mit.edu] 
Sent: Thursday, November 13, 2008 4:31 PM
To: tz at lecserver.nci.nih.gov
Subject: Re: Posix Timezone format


On Nov 13, 2008, at 3:05 PM, Louis Guindon wrote:

> My goal is to provide a user interface showing the information  
> derived from the TZ zone name. Based on the selected TZ zone name by  
> the user, I will assign the corresponding POSIX time zone string to  
> the Linux /tmp/TZ file. This way the local time will show up  
> properly for the user.

I.e., you're trying to make an application to give the user a list of  
time zones, let them select a time zone, and make that the system time  
zone?

Note that most if not all Linux systems use the Olson time zone  
database, so they are not required to have a POSIX time zone string as  
the time zone setting.

> However, I am having difficulty to find a reliable source for POSIX  
> time zone string representation for each defined time zone in the  
> Olson database.

There isn't necessarily a POSIX time zone string representation for  
each defined time zone.  POSIX time zone strings can't represent an  
arbitrary Olson-style time zone - they can't, for example, handle time  
zones where the rules change from year to year.

> I don't know if there is an alternative way, but I am also wandering  
> if the TZ time zone name can used directly without going through the  
> POSIX representation of the time zone.

On many UN*Xes, it can (Solaris, most if not all other SVR4  
derivatives, most if not all Linux distributions,  
{Free,Net,Open,DragonFly}BSD, Mac OS X/iPhone OS).





More information about the tz mailing list