Discovering the XOs local timezone in a bash script

Samuel Greenfeld greenfeld at
Sat Mar 12 22:21:47 EST 2011

The XO image OLPC supplies defaults to UTC.   Users can select a time 
zone offset in Sugar if they want, but it is purely a numerical control 
at last check and does not allow you to choose a setting that is 
regional (like "America/New York" or "EST5EDT", which include Daylight 
Savings support).

Sugar reports only relative times in its core GUI, so I don't know how 
common it is for deployments or other users to actually change this 
setting.  Setting a time zone other than UTC with 10.1.3 and prior may 
also expose a flaw where the offset is repetitively applied every 
reboot, shifting the clock.

Perhaps proper time zone support (with the optional frame clock some 
deployments like) could be part of the 11.2.0 release if there is a good 
reason to include it.  But that's a design discussion for the 
Sugar-devel list, as I don't quite know why Sugar avoids showing actual 
times in the first place.

If we decide to include a Calendar app in 11.2.0 that might also be good 
justification for making time zone support easier to use.


On 3/12/2011 10:05 PM, Richard A. Smith wrote:
> I've added a new feature in my power logging processor that allows the
> plotting of power input vs time of day.  To do this I have to know the
> local timzone so I can translate the UTC datestamp back to the local time.
> `date` says the XO's timezone is set to UTC so I'll have to get it from
> somewhere else.
> Can someone give me a quick rundown of how we are managing timezones so
> I know what to look at to determine this?

More information about the Devel mailing list