Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhantomJS set browser timezone setting

I am running Karma with PhantomJS to run some unit tests.

In my unit tests there are some tests which do some date comparison which all pass when run locally.

Our build server is on a different timezone and the date tests are failing due to different timezones.

I looked at phantomjs options to and didn't see any option regarding locale or timezone. Is it possible to configure phantomJs to the same timezone on every computer even though they are different timezones ?

like image 415
Ovidiu Buligan Avatar asked Dec 09 '25 22:12

Ovidiu Buligan


1 Answers

If you're running it using a shell, you might use the TZ environment variable. E.g.

TZ=Europe/Berlin phantomjs script.js
like image 50
user965748 Avatar answered Dec 11 '25 13:12

user965748



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!