-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Should be an option to return local times from toISOString #1751
Labels
Comments
+1 Maybe something like moment().toISOString({tz: false}); // .utc().format()
moment().toISOString({tz: "local"}); // .local().format()
moment().toISOString({tz: true}); // depend on the object (utc, local, zoned moment)
moment().toISOString({tz: "05:00"}); // .zone(str).format() Internally it would do |
ashsearle
added a commit
to ashsearle/moment
that referenced
this issue
Dec 3, 2017
marwahaha
pushed a commit
that referenced
this issue
Dec 17, 2017
This was referenced Dec 17, 2017
This was done in 2.20.0:
|
I am doing this but still not able to get local time. Can somebody help me please :) Doing this:
|
moment().toISOString(true) not working as expected for 2.7.0 . not sure about latest version but flag does not help. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
toISOString
always returns UTC times. We should support a flag that lets you return the local time instead of requiring the user to do:The text was updated successfully, but these errors were encountered: