How can date_default_timezone be set for a created date column ?

QuestionsHow can date_default_timezone be set for a created date column ?
toki asked 6 years ago

Hi Abu,

There is an hour difference with my phpgrid time field and computer system time. Therefore I try to use date_default_timezone_set in formatoptions. But It does not work ? Is there any other solution or formatoption for this ?

$col["formatter"] = "date"; // format as date
$col["formatoptions"] = array("srcformat"=$'Y-m-d', "newformat"=$'d.m.Y'),"date_default_timezone_set"=$'Europe/Istanbul');

Regards…

1 Answers
toki answered 6 years ago

Hi Abu,

date_default_timezone_set('Europe/Istanbul'); // TO PUT THIS LINE IN PHP PAGE SOLVES TIMEZONE PROBLEM

$bg=date("d-m-Y");

$db_conf = array();
$db_conf["type"] = "mysql"; // mysql,oci8(for oracle),mssql,postgres,sybase
$db_conf["server"] = "localhost";
$db_conf["user"] = "root";
$db_conf["password"] = "";
$db_conf["database"] = "test";

Please, don't mind for my being in a hurry sometimes.

Regards…

Your Answer

5 + 16 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!