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

icambron opened this Issue Jul 2, 2014 · 2 comments


None yet
3 participants

icambron commented Jul 2, 2014

toISOString always returns UTC times. We should support a flag that lets you return the local time instead of requiring the user to do:


@icambron icambron added the Enhancement label Jul 2, 2014


This comment has been minimized.


ichernev commented Jul 2, 2014


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 .local, .utc or .zone. Now it only does .utc.


This comment has been minimized.


marwahaha commented Apr 13, 2018

This was done in 2.20.0:


@marwahaha marwahaha closed this Apr 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment