This topic is locked

Timezone problem

10/27/2007 9:37:43 AM
PHPRunner General questions
I
Idol author

Hi!

I've created a field with the 'DATETIME' function!
The problem is that my server is in Sweden, and my site would be used in Portugal!

There is 1 h time difference between the two nations!(the portugal's time is one hour behind the swedish time)
I've tried this code :ini_set("date.timezone","Europe/Lisbon");

in the dbcommon.php

I still get the swedish time!(I don't get an error either.)
the other solution which I 've found in the forum is this one:

Instead of now() I've read that I could insert something like the following line!
("h", -1 , Now())
I've put it in the "edit as"!...like the picture below!


And I've got the following error:

Parse error: parse error, unexpected ',' in /data/members/paid/c/o/coadro.com/htdocs/www/test1/_TableName_add.php on line 239
P.S I don't have access to the php.ini file...so I can't fix it that way!
Regards!

Sergey Kornilov admin 10/27/2007

Try the following:

date('Y-m-d', strtotime("-1 hour"))
I
Idol author 10/27/2007

Try the following:

date('Y-m-d', strtotime("-1 hour"))


Hi Sergey,
I've tried the code...and in the site I get 'time-date 27-10-2007 0:00:00'
The date is correct, but I get 0:00:00 hours all the time!
Regards.

Sergey Kornilov admin 10/27/2007

Got it

date('Y-m-d h:m:s A', strtotime("-1 hour"))
I
Idol author 10/28/2007

Got it


date('Y-m-d h:m:s A', strtotime("-1 hour"))


Thanks Sergey,
This code works perfectly!
Best Regards.