You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moment keeps track of instances in time (i.e. milliseconds since 1970 UTC). What you're doing when you say utc() or zone(), you're changing how that time is expressed (i.e. we say "9:00" in EST but "6:00" in PST, but it's the same time). So converting it back in to a date drops the "you should print dates differently" metadata. It's still the same time.
It sounds like you want to modify the actual time? We don't have a "mutate the time so that it will be displayed the same way in this other zone" feature, though, we've discussed it (or do we, @ichernev?)
FWIW, everyone will be quicker to help you with open source if you approach a functionality gap with "hey, I need this feature, how can I help?" rather than as you did.
I get the exact same moment object after running zone(-1) as I do when I don't run it. Example:
console.log( moment().utc().toDate() );
console.log( moment().utc().zone(-1).toDate() );
I would expect this to adjust the Date object according to the timezone offset, but it does... well, nothing.
The text was updated successfully, but these errors were encountered: