[Solved] Setting the timezone doesn't work

Handle problems or report system bug
Post Reply
User avatar
francisco
Posts: 62
Joined: Tue Mar 07, 2023 1:48 pm
Location: Brazil
Contact:

[Solved] Setting the timezone doesn't work

Post 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)}}
Last edited by francisco on Sat Feb 24, 2024 4:22 pm, edited 1 time in total.
😴
Administrator
Site Admin
Posts: 34
Joined: Tue Mar 07, 2023 7:56 am

Re: Setting the timezone doesn't work

Post by Administrator »

User avatar
francisco
Posts: 62
Joined: Tue Mar 07, 2023 1:48 pm
Location: Brazil
Contact:

Re: Setting the timezone doesn't work

Post 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
😴
Administrator
Site Admin
Posts: 34
Joined: Tue Mar 07, 2023 7:56 am

Re: Setting the timezone doesn't work

Post by Administrator »

use server.date() it will work same as {{date()}} tag
User avatar
francisco
Posts: 62
Joined: Tue Mar 07, 2023 1:48 pm
Location: Brazil
Contact:

[Solved] Setting the timezone doesn't work

Post 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!
😴
Post Reply