Discovering the XOs local timezone in a bash script

2011-03-12 Thread Richard A. Smith
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 somewh

Re: Discovering the XOs local timezone in a bash script

2011-03-12 Thread C. Scott Ananian
Last I knew we used standard Linux conventions for timezones and sugar called the standard Linux commands (via sudo) to set the timezone. But that should make 'date' report the correct local time (unless you use '-u') so maybe someone broke that sometime in the past two years. Check /etc/timezone?

Re: Discovering the XOs local timezone in a bash script

2011-03-12 Thread Samuel Greenfeld
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).

Re: Discovering the XOs local timezone in a bash script

2011-03-12 Thread Richard A. Smith
On 03/12/2011 10:21 PM, Samuel Greenfeld wrote: > 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 "

Re: Discovering the XOs local timezone in a bash script

2011-03-12 Thread Mikus Grinbergs
Well, 'My Settings' -> 'Date & Time' allows the user to specify the local timezone (I always do this) - but I'm not sure which routines actually make use of that setting. It can be extracted by (all on one line): gconftool-2 --direct --config-source=xml:readwrite:/home/olpc/.gconf/desktop/sugar/

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Sascha Silbe
Excerpts from C. Scott Ananian's message of Sun Mar 13 04:06:56 +0100 2011: > Last I knew we used standard Linux conventions for timezones and sugar > called the standard Linux commands (via sudo) to set the timezone. Can you point me at that old code, please? (we currently use gconf [1], so Suga

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Paul Fox
sascha wrote: > Excerpts from C. Scott Ananian's message of Sun Mar 13 04:06:56 +0100 2011: > > > Last I knew we used standard Linux conventions for timezones and sugar > > called the standard Linux commands (via sudo) to set the timezone. > > Can you point me at that old code, please? (we

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Sascha Silbe
Excerpts from Paul Fox's message of Sun Mar 13 13:04:30 +0100 2011: > > Can you point me at that old code, please? (we currently use gconf [1], > > so Sugar is decoupled from the rest of the system w.r.t. time zone). > do you know why this is/was done? is it simply a matter of not > wanting th

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Martin Langhoff
On Sat, Mar 12, 2011 at 10:21 PM, Samuel Greenfeld wrote: > 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 All correct AFAIK. For background on why deployments are not setting the TZ, Daniel recently

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Daniel Drake
On 13 March 2011 03:21, Samuel Greenfeld wrote: > 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 off

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread C. Scott Ananian
I apologize; I think the code that sets timezone "correctly" might have been code I wrote for litl, not OLPC. --scott On Sunday, March 13, 2011, Daniel Drake wrote: > On 13 March 2011 03:21, Samuel Greenfeld wrote: >> Sugar reports only relative times in its core GUI, so I don't know how >> co

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Richard A. Smith
On 03/13/2011 11:15 AM, Daniel Drake wrote: > On 13 March 2011 03:21, Samuel Greenfeld wrote: >> 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.

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Daniel Drake
On 13 March 2011 15:49, Richard A. Smith wrote: > Thanks for clearing that up.  I've checked on build 860 and `date` reports > the timezone selected via the control panel.  So that gives me what I need. That only applies when you're in the sugar environment though. If you're dealing with data gen

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Richard A. Smith
On 03/13/2011 11:56 AM, Daniel Drake wrote: > On 13 March 2011 15:49, Richard A. Smith wrote: >> Thanks for clearing that up. I've checked on build 860 and `date` reports >> the timezone selected via the control panel. So that gives me what I need. > > That only applies when you're in the sugar

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Sascha Silbe
Excerpts from C. Scott Ananian's message of Sun Mar 13 16:41:36 +0100 2011: > I apologize; I think the code that sets timezone "correctly" might > have been code I wrote for litl, not OLPC. No problem. Do you remember how it worked at Litl? Did you manipulate /etc/timezone directly or using a dis

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread C. Scott Ananian
On Sun, Mar 13, 2011 at 1:04 PM, Sascha Silbe wrote: > Excerpts from C. Scott Ananian's message of Sun Mar 13 16:41:36 +0100 2011: > >> I apologize; I think the code that sets timezone "correctly" might >> have been code I wrote for litl, not OLPC. > > No problem. Do you remember how it worked at

Re: Discovering the XOs local timezone in a bash script

2011-03-13 Thread Sascha Silbe
Excerpts from C. Scott Ananian's message of Sun Mar 13 18:13:26 +0100 2011: [description of how time zone handling works on Litl] Thanks! Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Dev