[Server-devel] timestamps on backups

Hamilton Chua hamilton.chua at gmail.com
Thu Sep 17 07:13:00 EDT 2009


Thanks Tom and Martin,

I think I have figured it out. Sorry for any confusion. 

It seems the timestamps are correct on the server, it is only when
displayed in the backup page (dsbackup.php) where the times are off. For
example, a backup done just a few minutes ago would say it was done 4
hours ago on that page.

The problem is the timezone. When I specifically set the "date.timezone"
parameter in php.ini to UTC, the text started appearing correctly in the
backup page. So it seems PHP is using a different timezone.

/etc/sysconfig/clock says that the timezone of the system is
"America/New York" which is probably the timezone PHP is using.


On Wed, 2009-09-16 at 15:05 -0700, Tom Mitchell wrote:
> On Wed, Sep 16, 2009 at 5:37 AM, Martin Langhoff
> <martin.langhoff at gmail.com> wrote:
> > On Wed, Sep 16, 2009 at 2:28 PM, Hamilton Chua <hamilton.chua at gmail.com> wrote:
> >> I'm not sure if anybody has noticed this yet but after doing a backup,
> >> it seems the datestamps on the backup page are wrong.
> >
> > We might need more detail than that if we're to understand the situation :-)
> >
> >> Is there something about time zones and time synchronization that we
> >> need to be aware of with regards to backups.
> >
> > Yes, the utc time on all machines should make sense. So do
> >
> >  date --utc
> >
> > on XS and on the laptops involved to make sure all players are in the
> > same decade. This has been tested with machines on different TZs so it
> > should work. As long as utc agrees across machines.
> 
> > --
> >  martin.langhoff at gmail.com
> > http://lists.laptop.org/listinfo/server-devel
> 
> The two numbers 4 hours and 40 years are almost telling.
> 
> Linux keeps time as seconds from midnight January 1, 1970 12:00:00 GMT.
> Today GMT (Greenwich Mean Time) has been replaced by UTS (Coordinated
> Universal Time)
> which is GMT done "better" with atomic clocks.
> 
> Since you are using XS on 0.6d5 and Sugar on a Stick the system gets the
> initial time of day (date) from the local hardware clock.   A unix/Linux system
> default sets the local hardware clock to UTS while windows sets it to
> local time.
> Depending on daylight savings time in (say) Oklahoma four hours looks
> like a Windows
> system setting the hardware time of day.  Since Linux can be configured to play
> nice with windows and set the hardware clock to local time windows is not
> always the issue in possiblly confusing the offset from GMT/UTS.
> 
> The 40 years is very close to the beginnig of unix time (zero seconds) and
> can be seen on a confused local time of day clock.
> 
> NTP (network time protocol) tools can be used to set the time of
> day on a network connected system to the correct UTS time.
> 
> Local time is computed based on UTS and an offset time zone.
> 
> Since all binary time stamps are UTS different users can set different
> timezone values in their environment and the system will do the 'right' thing.
> 
> See:
>   date
>   date --uts
>   date -u
>   (export TZ="Europe/Paris";date;date-u)
> #
>  touch /tmp/now
>  stat /tmp/now
>  (export TZ="Europe/Paris"; stat now)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 



More information about the Server-devel mailing list