PHP date()
and time()
return the wrong time:
When date.timezone = "Europe/Riga"
time returned by date()
was 03-12-2011 08:57:12
, but the system time was 03-12-2011 01:57:12
(the time zone Europe / Riga is right time at that moment). When I changed the time zone to βEurope / Londonβ, the time changed to 03-12-2011 06:57:12
(actual time 02-12-2011 23:57:12
)
The time returned by date
/ hwclock --show
was correct ( 03-12-2011 01:57:12
with the system time zone set in Riga)
OS: Debian 6.0
I checked most of the questions regarding similar questions on SO / Google, but all of them did not seem to indicate the wrong time zone.
As far as I can tell, there is a problem between php -> os. Of course, since the wrong time offset is always constant, I could subtract the difference, but this is not the right solution.
Any ideas would be highly appreciated.
relic
source share