Page 1 of 1

TimeZone +6 hrs ahead when retrieving datetime from userfn.php

Posted: Fri Aug 02, 2024 8:42 pm
by sticcino

v2024

locale: en-US ( "time_zone": "America/New_York")

when retrieving datetime from withing the userfn.php using currentdatetime(), it is always returning 6hrs ahead.
tested with date("F j, Y, g:i a"), and this is also returning 6hrs ahead.

is there another location or file that is setup incorrectly that we missed?


Re: TimeZone +6 hrs ahead

Posted: Fri Aug 02, 2024 8:47 pm
by sticcino

notes:

in page load function as a test:

function Page_Loading()
{
    global $BODY_CLASS;

    date_default_timezone_set('America/New_York');
    $StartDate = CurrentDateTime();
    
**$StartDate = correct time**
}

but it does not hold, once it goes back into one of the functions, the time jumps +6hrs


Re: TimeZone +6 hrs ahead when retrieving datetime from userfn.php

Posted: Fri Aug 02, 2024 10:54 pm
by arbei

Note that in Global Code, the Language class is not loaded yet. You may load it yourself by calling Security(), or you should call your function later.