Issue with UTC?
Hi what does the enable UTC parameter do?
I have a problem with a counter, if I set the time in UTC and sets the UTC flag to true. The remaining time still varies if I change timezone on my computer. Has I misunderstood the flag?
Regards, Jens
Hello @scrog, The UTC flag was added later on the project development. The plugin will create a Date object with the given parameters (year, month, dayn hours, minutes and seconds). This date is created without using any timezone parameter like so :
let d = new Date(year, month, day, hours, minutes, seconds);
Then ig you enable the UTC flag, the plugin will turn the original date object nto a new one using the previous Date object data like this :
let utcDate = new Date(
d.getUTCFullYear(),
d.getUTCMonth(),
d.getUTCDate(),
d.getUTCHours(),
d.getUTCMinutes(),
d.getUTCSeconds()
);
So, as you can see, the first Date object created is using the browser timezone... You just point on a real issue and adding a timezone parameter will be a great solution to solve it.
I think adding a date object parameter should be a great option to solve this issue. With this new parameter, users will be able to select the way they want to inject the date into the plugin.
Hi, I'm not sure if I missed it, but has the timezone parameter been added? How can we use it?