We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Define timeZone on Phalcon

There is some function for define timezone ? or only use the date_default_timezone_set ?

I would just use the one you mentioned.

date_default_timezone_set($timeZone);

should work for any date functions.



31.2k
Accepted
answer
edited Apr '15

Yes

        $today = new DateTime();

        $today->setTimezone(new DateTimeZone('Africa/Nairobi'));

        $today = $currentDate->format('Y-m-d h:i:s');

You can play around it to make it suitable for your use.

thanks!>.. i used date_default_timezone_set($timeZone);