Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example timezone option in README #13

Open
noahmatisoff opened this issue Dec 13, 2015 · 1 comment
Open

Example timezone option in README #13

noahmatisoff opened this issue Dec 13, 2015 · 1 comment

Comments

@noahmatisoff
Copy link

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?

@hogart
Copy link
Owner

hogart commented Dec 13, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants