Share » Forums » Developer » possible bug in datetime formatting

possible bug in datetime formatting

possible bug in datetime formatting

Wednesday 19 July 2006 12:27:39 pm - 2 replies

Modified on Wednesday 19 July 2006 12:38:31 pm by Marko Žmak

Author Message

Marko Žmak

Thursday 20 July 2006 8:20:09 am

I just made a script to verify time in PHP and this is what I got:

Sistemi timestamp: time() = 1153408523
Into date/time: gmdate("M d Y H:i:s", 1153408523) = Jul 20 2006 15:15:23
Into local date/time: date("M d Y H:i:s", 1153408523) = Jul 20 2006 17:15:23
Time zone: date("O", 1153408523) = +0200

But in eZ (as I mentioned) I get the time zone "+0100". Why? Where from is the time zone derived in eZ?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Monday 24 July 2006 6:12:27 am

I solved this one. The problem was in the "dayligh saving" change of time also known as CEST.
Regarding to this, here's a suggestion to everyone. I was trying to get the today's date (with 00:00h) from the currentdate() function like this:

{def $today_date=currentdate() $one_hour=3600 $one_day=mul(24,$one_hour)}
{set today_date=mul(floor(div($today_date,$one_day)),$one_day)}

This is not correct. You should add this line after the above code:

{set today_date=sub($today_date,mul(datetime('custom', '%O'),$one_hour))}

So that the time is adapted to the apropriate time zone.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu