Bugzilla@Mozdev – Bug 26629
Force-using fixed time zone (e.g. GMT) for date/time
Last modified: 2019-07-28 06:44:05
You need to log in before you can comment on or make changes to this bug.
When replying or forwarding email it would be great to be able to use the time/date from the original sender's email in a fixed time zone such as GMT and not always the local one where one happens to be at the moment. Background: Data protection - people moving a lot between different time zones don't necessarily want to reveal their current location when using the extension for generating reply/forwarding headers. An option to always use GMT and not any arbitrary fixed time zone might already be good enough.
I suggest adding a global switch similar to the %X:=calculated(d,h:m)% which will toggle the (forced) timezone for the remainder of the template %X:=timezone(GMT)% force time zone to GMT %X:=timezone(BST)% force time zone to British Summer Time (UTC+01) %X:=timezone(EST)% " " " Eastern Standard Time %X:=timezone(MDT)% " " " Mountain Daylight Time (North America) %X:=timezone(WST)% " " " Western Standard Time %X:=timezone()% Reset timezone to current timezone of Device where ST4 runs
Created an attachment (id=8578) [details] 2.1 pre 30 Using the time abbreviations and offsets documented at: https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations this will now recalculate times by creating the UTC offset (which is subtracted from the time) and then adding the offset for the desired timezone. To debug this, enable SmartTemplateā“ debug mode in advanced settings. Then look in JavaScript error console for messages like this: SmartTemplate4 Adding timezone offsets: UTC Offset: 0 Forced Timezone:-6 I have tested the forced timezone but am not sure about UTC offset (as I am currently within a timezone that is on the same time as UTC). Timezones supported (and associated offsets) case "ACDT": return 10.5; case "ACST": return 9.5; case "ACT": return -5; case "ACWST": return 8.75; case "ADT": return -3; case "AEDT": return 11; case "AEST": return 10; case "AFT": return 4.5; case "ART": return -3; case "AKDT": return -8; // Alaska Daylight case "AKST": return -9; case "AMST": return -3; case "ART": return -3; case "AST": return -4; //Atlantic Standard Time case "AWST": return 8; case "AZOST": return 0; case "AZOT": return -1; case "AZT": return 4; case "BDT": return 8; case "BIOT": return 6; case "BIT": return -12; case "BOT": return -4; case "BRST": return -2; case "BRT": return -3; case "BST": return 1; // British Summer Time case "BTT": return 6; case "CAT": return 2; case "CCT": return 6.5; case "CDT": return -5; // Central Daylight (North America) case "CEST": return 2; case "CET": return 1; case "CHADT": return 13.75; case "CHAST": return 12.75; case "CHOT": return 8; case "CHIST": return 9; case "CHST": return 10; case "CHUT": return 10; case "CIST": return -8; case "CIT": return 8; case "CKT": return -10; case "CLST": return -3; case "CLT": return -4; case "COST": return -5; case "CST": return -6; // Central Standard Time (North America) case "CT": return 8; case "CVT": return -1; case "CWST": return -8.75; // Central Western Standard Time (Australia) unofficial case "CXT": return 7; case "DAVY": return 7; case "DDUT": return 10; case "DFT": return 1; case "EASST": return -5; case "EAST": return -6; case "EAT": return 3; case "ECT": return -4; //Eastern Caribbean Time case "EDT": return -4; // Eastern Daylight Time (North America) case "EEST": return 3; case "EET": return 2; case "EGST": return -1; case "EGT": return -1; case "EIT": return 9; case "EST": return -5; // Eastern Standard Time (North America) case "FET": return 3; case "FJT": return 12; case "FKST": return -3; case "FKT": return -4; case "FNT": return -2; case "GAKT": return -6; case "GAMT": return -9; case "GFT": return -3; case "GILT": return 12; case "GIT": return -9; case "GMT": return 0; case "GST": return 4; // Gulf Standard Time case "GYT": return -4; case "HDT": return -9; case "HAEC": return 2; case "HST": return -10; case "HKT": return 8; case "HMT": return 5; case "HOVST": return 8; case "HOVT": return 7; case "ICT": return 7; case "IDLW": return -12; case "IDT": return 3; case "IOT": return 3; case "IRDT": return 4.5; case "IRKT": return 8; case "IRST": return 3.5; case "IST": return 5.5; case "JST": return 9; case "KALT": return 2; case "KGT": return 6; case "KOST": return 11; case "KRAT": return 7; case "KST": return 9; case "LHST": return 10.5; // Lord Howe Standard Time case "LINT": return 14; case "MAGT": return 12; case "MART": return -9.5; case "MAWT": return 5; case "MDT": return -6; case "MEET": return 1; case "MEST": return 2; case "MHT": return 12; case "MIST": return 11; case "MIT": return -9.5; case "MMT": return 6.5; case "MSK": return 3; case "MST": return -7; // Mountain Standard Time (North America) case "MUT": return 4; case "MVT": return 5; case "MYT": return 8; case "NCT": return 11; case "NDT": return -2.5; case "NFT": return 11; case "NPT": return 5.75; case "NST": return -3.5; case "NT": return -3.5; case "NUT": return -11; case "NZDY": return 13; case "NZST": return 12; case "OMST": return 6; case "ORAT": return 5; case "PDT": return -7; case "PET": return -5; case "PETT": return 12; case "PGT": return 10; case "PHOT": return 13; case "PHT": return 8; case "PKT": return 5; case "PMDT": return -2; case "PMST": return -3; case "PONT": return 11; case "PST": return -8; //Pacific Standard Time (North America) case "PYST": return -3; case "PYT": return -4; case "RET": return 4; case "ROTT": return -3; case "SAKT": return 11; case "SAMT": return 4; case "SAST": return 2; case "SBT": return 11; case "SCT": return 4; case "SDT": return -10; case "SGT": return 8; case "SLST": return 5.5; case "SRET": return 11; case "SST": return 8; //Singapore Standard Time case "SYOT": return 3; case "TAHT": return -10; case "THA": return 7; case "TFT": return 5; case "TJT": return 5; case "TKT": return 13; case "TLT": return 9; case "TMT": return 5; case "TRT": return 3; case "TOT": return 13; case "TVT": return 12; case "ULAST": return 9; case "ULAT": return 8; case "UTC": return 0; case "UYST": return -2; case "UYT": return -3; case "UZT": return 5; case "VET": return -4; case "VLAT": return 10; case "VOLT": return 4; case "VOST": return 6; case "VUT": return 11; case "WAKT": return 12; case "WAST": return 1; case "WAT": return 2; case "WEST": return 1; case "WET": return 0; case "WST": return 8; case "YAKT": return 9; case "YEKT": return 5; (I left out duplicate abbreviations and preferred the "more popular" timezone)
Complete: Release 2.1 - 28/07/2019