Created
January 18, 2017 15:35
-
-
Save benjaminparnell/2aeccdd138527048f90f63df4790f7b9 to your computer and use it in GitHub Desktop.
This file contains 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
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