Oliver,

It's early in the morning over here, so that's my excuse for feeling confused...

> >> select FROM_UNIXTIME(UNIX_TIMESTAMP(),
> >>                      '%Y %D %M %h:%i:%s %x');
> >> UNIX_TIMESTAMP() returns the number of seconds since '1970-01-01
> 00:00:00' GMT
> >> Convert this to a date format and you have a GMT date.
> >> The only prob is daylight savings. We in NSW, Australia are currently
> >> in daylight savings and the date returned doesn't accomodate for that.
> >> Any one have any ideas why?

Checking the MySQL manual (6.3.4  Date and Time Functions)
UNIX_TIMESTAMP()
UNIX_TIMESTAMP(date)
...returns a Unix timestamp (seconds since '1970-01-01 00:00:00' GMT) ...in local time:

The reference value (date) is stated in, or the implicit NOW() is taken in, local time 
- NOT GMT.
GMT [sic, UTC] has NO daylight savings component.

The allowance for daylight saving depends upon which timezone the server is set to, 
and what time of year the
ToD clock is showing (indeed I'm wondering if there are some systems which allow 
user-definition of whether
summer time is ever to be applied).

Is the question (above) ambiguous? Which part is in GMT and which part local? Which 
part is adjusted for summer
time and which part is coordinated time?

> Perl seems to work with daylight savings, how is this?

=the processing of times/dates provided by the OpSys is subject to whatever the 
application cares to do with it.
PHP will give you the choice to work in local time or GMT. If I take a timestamp or 
date field from MySQL, I'll
definitely reformat it before making it available for 'public consumption'. ('they' 
don't seem to like
CCYY-MM-DD dates!?)

> >UTC doesn't do daylight savings.  One reason is that different places
> >do daylight savings at different times.  We here in the Western US, for
> >example, are in standard time right now.  In Arizona, they don't do
> >daylight savings at all.

=indeed. The whole reason for Universal Coordinated Time was so that there would be a 
reference-time 'zone' that
is rigorously continuous. It is defined atomic clocks, not on astronomical 
position/variation - or some
convenience of human interpretation of such.

=Regards,
=dn



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to