Timestamp Problem
Hi
I have recently come across a problem with timestamps, it seems when using
the date function to return a formatted timestamp the result can depend on
what your server global time settings are E.G. summer time, GTM+1 etc.
It seems logic to me that if I say here is a timestamp please return a
formatted
time it shouldn't make any odds what the server is set to.
$datein = 1177891200;
$formatted_date = date("D j M y H:i:s a", $datein);
echo $formatted_date;
I make "Mon 30 Apr 07 00:00:00 am" if I set the server to
GTM and forget British summer time, so how do I know
which timestamp is correct? Can somebody tell me what time
they make 1177891200 to be
This has caused a lot of problem recently can somebody please explain
why this is, I quick answer would be very grateful
Brian
Re: Timestamp Problem
Message-ID: <TDm9i.20485$xU4.5664 [at] newsfe1-gui.ntli.net> from Brian
contained the following:
>It seems logic to me that if I say here is a timestamp please return a
>formatted
>time it shouldn't make any odds what the server is set to.
The timestamp is the number of seconds since the Unix epoch. But at the
Unix epoch, server were at different times throughout the world. So
it's not one datetime, it's many.
>$datein = 1177891200;
>$formatted_date = date("D j M y H:i:s a", $datein);
>echo $formatted_date;
>
>I make "Mon 30 Apr 07 00:00:00 am" if I set the server to
>GTM and forget British summer time, so how do I know
>which timestamp is correct? Can somebody tell me what time
>they make 1177891200 to be
Mon 30 Apr 07 01:00:00 am. My server time.
Different for America of course
http://www.unixtimestamp.com/index.php
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011