Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate different timezone between browser and server for local test [duplicate]

I developed a web application (with java) and in it I have a business rule which requires saving the user time signature. But I need to save 3 times: Local timezone user, global timezone, and server timezone.

My problem is to test the local timezone of the user. Anyone know how I can simulate (only for a test in local machine) a different timezone to the browser, or server, for me to simulate this test?

Note: I thought I'd create a virtual machine and host my application on it, and take the test, it would have only to change the timezone of the virtual machine. So this process will require a long time, I want to know if there is any simple way.

like image 242
Erico Souza Avatar asked Sep 19 '25 14:09

Erico Souza


1 Answers

I discovered that I can manually set the GMT by tomcat arguments. To easy:

-Duser.timezone=GMT+13

As I needed to simulate a zone far away time, I put GMT + 13. Then my server got GMT + 13, and my client (browser) with GMT-3

like image 143
Erico Souza Avatar answered Sep 22 '25 04:09

Erico Souza