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

Add utc mode #158

Closed
timrwood opened this issue Feb 3, 2012 · 4 comments
Closed

Add utc mode #158

timrwood opened this issue Feb 3, 2012 · 4 comments
Milestone

Comments

@timrwood
Copy link
Member

timrwood commented Feb 3, 2012

See comments starting here.

#147 (comment)

@timrwood
Copy link
Member Author

timrwood commented Feb 3, 2012

Perhaps there can be a switch between utc and local time. Something like this maybe.

moment().utc().format('YYYY-MM-DD') // format in utc time
moment().format('YYYY-MM-DD') // format in local time

The utc flag would stay with the object, and then it could be removed as well.

var a = moment().utc();
a.format() // format in utc time
a.local() 
a.format() // format in local time

Then we could also add a parsing function to the root object (not the prototype) to create the moment in utc time.

moment.utc('10-10-2012', 'MM-DD-YYY'); // same as below
moment('10-10-2012', 'MM-DD-YYY').utc(); // same as above

@deepwell
Copy link

deepwell commented Feb 3, 2012

I'm happy with that.

@icambron
Copy link
Member

+1

timrwood added a commit that referenced this issue Mar 2, 2012
@timrwood
Copy link
Member Author

timrwood commented Mar 2, 2012

This is done

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

No branches or pull requests

3 participants