PhantomJS set browser timezone setting

主宰稳场 提交于 2019-12-24 06:26:04

问题


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 ?


回答1:


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

TZ=Europe/Berlin phantomjs script.js


来源:https://stackoverflow.com/questions/21702903/phantomjs-set-browser-timezone-setting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!