Created
September 8, 2012 21:34
-
-
Save nanasess/3679940 to your computer and use it in GitHub Desktop.
moment.js timezone support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moment.fn.timezoneOffset = function(zone) { | |
var diff = this.zone() + (zone * 60); | |
return this.clone().add('minutes', diff); | |
}; | |
moment.timezoneOffset(+9).format('YYYY/M/D hh:mm:ss'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment