Skip to content

Instantly share code, notes, and snippets.

@benjaminparnell
Created January 18, 2017 15:35
Show Gist options
  • Save benjaminparnell/2aeccdd138527048f90f63df4790f7b9 to your computer and use it in GitHub Desktop.
Save benjaminparnell/2aeccdd138527048f90f63df4790f7b9 to your computer and use it in GitHub Desktop.
var moment = require('moment-timezone')
, prevAbbr = moment.fn.zoneAbbr
, timezoneTranslations = {
'Europe/Istanbul': 'TSİ'
}
moment.fn.zoneAbbr = function () {
var customTimezoneTranslation = timezoneTranslations[this._z.name]
return customTimezoneTranslation || prevAbbr.call(this)
}
var str = moment().tz('Europe/Istanbul').format('HH:mm:ss z')
console.log(str)
// 15:11:39 TSİ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment