timezone-mock | A JavaScript library to mock the local timezone | Date Time Utils library
kandi X-RAY | timezone-mock Summary
kandi X-RAY | timezone-mock Summary
A JavaScript library to mock the local timezone
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of timezone-mock
timezone-mock Key Features
timezone-mock Examples and Code Snippets
Community Discussions
Trending Discussions on timezone-mock
QUESTION
I am facing some challenges to find a better way to test timezones, what is happening now is:
I have a report with some links (for detailed data), when the user access this report comes the transaction date as one of the columns (lets say its today 11th) When the user clicks at one of these links to have more details about the transaction, the user is transferred to the detail page.
The bug is, when the timezone is UTC-04 the user gets the date of 10th instead of 11th, it only works properly with the UTC+2
I have tried to mock the change of timezone using this: https://www.npmjs.com/package/timezone-mock
But didn't work as I wanted, the date is changed but the bug doesn't happen.
It is possible to reproduce this only when I change manually the timezone from windows.
I also found the possibility of using powershell commands to do this
Setting timezone in Protractor e2e tests
https://www.npmjs.com/package/node-powershell
So far I could not make it work.
The question is, is it possible to automate the change of window's (system) timezone somehow?
Ty!
...ANSWER
Answered 2019-Feb-12 at 08:18So, after some time trying and failing.. found this:
tzutil.exe works for windows 10 and windows server as well, it is really simple to execute, the function needs to be like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install timezone-mock
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page