Use time zone in API actions

Tips submitted by PHPMaker users
Post Reply
sticcino
User
Posts: 1043

Use time zone in API actions

Post by sticcino »

locale en -- timzezone set to "us/eastern"

just noticed the time returned is 5 hours ahead.

Current Eastern time is 4:20 pm

CurrentTime() = 21:20:41
CurrentDateTime() = 12-7-2020, 21:20

trying to retrieve in userfn.php inside Api_Action $api-post() functions


mobhar
User
Posts: 11703

Post by mobhar »

Make sure you have already used the correct timezone. Try US/Eastern instead of us/eastern.

For more info, please visit: https://www.php.net/manual/en/timezones.others.php


sticcino
User
Posts: 1043

Post by sticcino »

you need to add:

global $Language;
$Language = Container("language");

in your api->get/post functions in order to get the timezone/time information.


Post Reply