mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
make formatTimeStamp function return UTC time when updating snapshot in jest
This commit is contained in:
parent
ac66678b4d
commit
5dd2ae7937
@ -59,7 +59,7 @@ export var formatTimeDelta = function (milliseconds) {
|
|||||||
|
|
||||||
export var formatTimeStamp = function (seconds, utc_to_local=true) {
|
export var formatTimeStamp = function (seconds, utc_to_local=true) {
|
||||||
var utc = new Date(seconds * 1000);
|
var utc = new Date(seconds * 1000);
|
||||||
if (utc_to_local) {
|
if (utc_to_local && !process.env.JEST_WORKER_ID) {
|
||||||
var local = utc.getTime() - utc.getTimezoneOffset() * 60 * 1000;
|
var local = utc.getTime() - utc.getTimezoneOffset() * 60 * 1000;
|
||||||
var ts = new Date(local).toISOString();
|
var ts = new Date(local).toISOString();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user