PHP: Odd behaviour with date_sunset function
Posted
by Svish
on Stack Overflow
See other posts from Stack Overflow
or by Svish
Published on 2010-05-14T20:51:06Z
Indexed on
2010/05/14
20:54 UTC
Read the original article
Hit count: 313
I'm having a look at the date_sunset function in PHP and have met an issue that I find a bit strange. I have this piece of code:
$sunset = date_sunset(mktime(0, 0, 0, 5, 14, 2010),
$format, // Format
55.596041, // Latitude
12.992495, // Longitude
90, // Zenith
2 // GMT Offset
);
For the three different formats, that would give me:
SUNFUNCS_RET_STRING 21:05
SUNFUNCS_RET_DOUBLE 21.095732016315
SUNFUNCS_RET_TIMESTAMP 1273863944 // H:i:s O -> 19:05:44 +0000
Why is the timestamp format ignoring the gmt offset? Is is supposed to be like that? If so what is the reason behind that?
© Stack Overflow or respective owner