Hi, I sent the message below before, but no response. Maybe because it was in html instead of plain text? Or am I the only one with this problem? Brecht
On 04/04/2012 14:56 Brecht Ameije wrote: > > Dear all, > > I'm trying to get the time zones right on my busybox embedded system. > > I'm in Belgium, this means we're on CET (UTC+1) and DST, thus UTC+2 At the > moment of the tests below, my local time is 2:35PM. > > My embedded system has no persistent time storage. So I use ntp to fetch the > time from the ntp pool. > This gives me UTC time. Setting up the environment var TZ takes me to local > time. > > When this is done, I set the hw clock to reflect my new system time. > > But now I come upon something strange: the "date -u" and the "hwclock -u" > commands give different results: > > $ export TZ=CET-1CEST,M3.5.0/2,M10.5.0/3 > $ ntpd -q -p 0.europe.pool.ntp.org # get current time > $ hwclock -w # set hw clock > $ date; date -u; hwclock; hwclock -u; hwclock -l > Wed Apr 4 14:35:55 CEST 2012 > Wed Apr 4 12:35:55 UTC 2012 > Wed Apr 4 14:35:54 2012 0.000000 seconds > Wed Apr 4 16:35:54 2012 0.000000 seconds > Wed Apr 4 14:35:54 2012 0.000000 seconds > > Both commands rely on the TZ variable, because when I don't set it, all > commands would respond with the correct UTC time (12:35PM). > > My first suspicion goes to the '-'-sign in the TZ variable: to set the time > zone to > CET, which is UTC+1, I have to write CET-1 instead of CET+1. This is > according to > http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html, > where it says to use '-' if east from prime meridian, '' or '+' if west. > > Any ideas? > > Thanks, > Brecht _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
