Time Issue in ticket request
Is this a BUG REPORT or FEATURE REQUEST?:
- [x] BUG
- [ ] FEATURE
What happened: Time when submit and time when agent comment in ticket request is different from time-zone
What did you expect to happen: Time should be display correctly with time-zone that have been set in time-zone setting
Environment:
- Trudesk Version: 1.1.8
- OS (e.g. from /etc/os-release): Ubuntu 16.04.7 LTS
- Node.JS Version: 12.18.3
- MongoDB Version: 3.6
- Is this hosted on cloud.trudesk.io: No

Did you restart the trudesk server after making the time zone change? This setting is applied during startup.
I did restarted the server, bro. Before I start installing via script, my time zone has been changed to +7 Asia/Phnom_Penh already.
Enable Debug mode by setting NODE_ENV=development
When you boot up trudesk. In the server log, does it show the correct time zone?
8/25 12:07:42 [28968] - info: . .o8 oooo
8/25 12:07:42 [28968] - info: .o8 "888 `888
8/25 12:07:42 [28968] - info: .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
8/25 12:07:42 [28968] - info: 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
8/25 12:07:42 [28968] - info: 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
8/25 12:07:42 [28968] - info: 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
8/25 12:07:42 [28968] - info: "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
8/25 12:07:42 [28968] - info: ==========================================================================
8/25 12:07:42 [28968] - info: trudesk v1.1.8 Copyright (C) 2014-2021 Chris Brame
8/25 12:07:42 [28968] - info:
8/25 12:07:42 [28968] - info: Running in: development
8/25 12:07:42 [28968] - info: Server Time: Wed Aug 25 2021 12:07:42 GMT-0400 (Eastern Daylight Time)
8/25 12:07:43 [28968] - info: Connected to MongoDB
8/25 12:07:45 [28968] - debug: Checking Default Settings...
8/25 12:07:45 [28968] - debug: MongoDB version 3.6 detected.
8/25 12:07:45 [28968] - debug: Timezone set to America/New_York
8/25 12:07:45 [28968] - debug: Registering Permissions...
8/25 12:07:45 [28968] - info: SocketServer Running
8/25 12:07:45 [28968] - debug: Building dynamic sass...
8/25 12:07:46 [28968] - info: TruDesk is now listening on port: 8118
8/25 12:07:46 [28968] - info: trudesk Ready
thanks for your tip bro. By the way, I am new to nodejs, would you mind to point me out where I could enable the debug mode and which server log name I should check to get information like yours?
Run export NODE_ENV=development on your prompt. Then start/restart trduesk
If you used the installs script. you can get the logs via running pm2 logs trudesk
thanks for pointing me out to the right location, bro. Here is the log, looks like the time zone is correct, I am using GMT +07 Asia/Phnom_Penh but in web interface shows differently.
I tried to enable debug mode using your instruction but i still can't get debug mode as yours. :(
The quickest way is to stop trudesk with pm2.
Then run NODE_ENV=development && node app.js
thanks for the tips once again, bro. here is the result.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This still needs a fix
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an issue in v1.2.3
Dashboard = OK
Messages = Partially OK
/tickets = Not OK
I posted here before: https://forum.trudesk.io/t/wrong-timezone-still-back-to-the-default-of-5/885
Tried modifying some filed by changing default time zone to my area but didn't work, seems like there are some .js files that's affecting the time zone (3.js).
However, time displayed correctly on the mobile version. Took a few screenshot last week:



3.js sets cookie to the default of America/New_York. Found a workaround, change the first entry of "America/New_York" to the local timezone in ~/trudesk/public/js/3.js, this works for me in linux debian (Trudesk v1.2.3 and v1.2.4):
sed -i 's/"America\/New_York"/"Asia\/Jakarta"/' /usr/src/trudesk/public/js/3.js
Another example if your timezone is Asia/Phnom_Penh:
sed -i 's/"America\/New_York"/"Asia\/Phnom_Penh"/' /usr/src/trudesk/public/js/3.js
If Trudesk is running on docker container, do this first:
docker exec -it <container_name> bash
Then execute the sed command above. Afterwards, just refresh the web browser or open a new tab of Trudesk dashboard.
Update: The file is 4.js on Trudesk v1.2.5