datef icon indicating copy to clipboard operation
datef copied to clipboard

Example timezone option in README

Open noahmatisoff opened this issue 9 years ago • 1 comments

How can the timezone be set to UTC when generating the date/time?

I see the option in the README but am struggling to understand how it can be set.

Can we include an example of setting the timezone in the doc?

noahmatisoff avatar Dec 13 '15 22:12 noahmatisoff

Unfortunately, you can't set timezone in JS. The only solution is to shift date to the difference between current TZ and desired TZ, convert it to ISO8601 string with desired TZ in proper position and then use Date.parse to create new instance of Date.

datef doesn't have capability to change dates, it only renders them.

As for example, this repo is not currently upstream and is not actually maintained, this one is: https://github.com/maxvipon/datef

hogart avatar Dec 13 '15 22:12 hogart