Page 1 of 1

[Solved] Setting the timezone doesn't work

Posted: Sun Feb 18, 2024 9:03 pm
by francisco
Hello! Timezone setting is not working in Web Server settings.
Using the code below does not actually change the timezone to UTC, it remains CET +01:00 (in Lua codes) - I think this is due to the fact that the Wapka server is located in Germany:

Code: Select all

server.timezone(env.timezone or 'UTC');
I also reported a while ago that the System Configuration "Local Time (Timezone)" does not work either, as the timezone always remains in UTC - I tried changing it for example to "(UTC-03:00) America/Fortaleza" but it doesn't work.

Output examples:

Code: Select all

Datetime (Lua)	             2024-02-18 22:00:21 +0100 CET    os.date("%Y-%m-%d %H:%M:%S %z %Z")
Datetime (DATE() function)   2024-02-18 21:00:21 +0000 UTC    {{DATE(Y-m-d H:i:s O e)}}

Re: Setting the timezone doesn't work

Posted: Wed Feb 21, 2024 4:16 pm
by Administrator

Re: Setting the timezone doesn't work

Posted: Wed Feb 21, 2024 9:41 pm
by francisco
Administrator wrote: Wed Feb 21, 2024 4:16 pm Problem Fixed for more
https://jonayed-hossan.com/wapka/server/timezone/
It is fixed only for the DATE function, in Lua scripting the timezone remains as CET by default.

Code: Select all

Datetime (Lua)                 2024-02-21 22:38:15 +0100 CET
Datetime (DATE() function)     2024-02-21 18:38:15 -0300 America/Fortaleza

Re: Setting the timezone doesn't work

Posted: Thu Feb 22, 2024 4:59 am
by Administrator
use server.date() it will work same as {{date()}} tag

[Solved] Setting the timezone doesn't work

Posted: Thu Feb 22, 2024 11:40 am
by francisco
Administrator wrote: Thu Feb 22, 2024 4:59 am use server.date() it will work same as {{date()}} tag
Now it works, thank you very much!