Skip to content

Instantly share code, notes, and snippets.

@nanasess
Created September 8, 2012 21:34
Show Gist options
  • Save nanasess/3679940 to your computer and use it in GitHub Desktop.
Save nanasess/3679940 to your computer and use it in GitHub Desktop.
moment.js timezone support.
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