@@ -23,7 +23,6 @@ const { ProductConfigurationManager } = require('@fxa/shared/cms');
2323const { Container } = require ( 'typedi' ) ;
2424
2525const DEFAULT_LOCALE = 'en' ;
26- const DEFAULT_TIMEZONE = 'Etc/UTC' ;
2726const UTM_PREFIX = 'fx-' ;
2827
2928const X_SES_CONFIGURATION_SET = 'X-SES-CONFIGURATION-SET' ;
@@ -186,15 +185,11 @@ module.exports = function (log, config, bounces, statsd) {
186185 }
187186
188187 function constructLocalTimeString ( timeZone , locale ) {
189- // if no timeZone is passed, use DEFAULT_TIMEZONE
190- moment . tz . setDefault ( DEFAULT_TIMEZONE ) ;
191188 // if no locale is passed, use DEFAULT_LOCALE
192189 locale = locale || DEFAULT_LOCALE ;
193- moment . locale ( locale ) ;
194- let timeMoment = moment ( ) ;
195- if ( timeZone ) {
196- timeMoment = timeMoment . tz ( timeZone ) ;
197- }
190+ const timeMoment = moment ( )
191+ . locale ( locale )
192+ . tz ( timeZone || 'Etc/UTC' ) ;
198193 // return a locale-specific time
199194 // if date or time is passed, return it as the current date or time
200195 const timeNow = timeMoment . format ( 'LTS (z)' ) ;
@@ -208,15 +203,11 @@ module.exports = function (log, config, bounces, statsd) {
208203 date ,
209204 formatString = 'L'
210205 ) {
211- // if no timeZone is passed, use DEFAULT_TIMEZONE
212- moment . tz . setDefault ( DEFAULT_TIMEZONE ) ;
213206 // if no locale is passed, use DEFAULT_LOCALE
214207 locale = locale || DEFAULT_LOCALE ;
215- moment . locale ( locale ) ;
216- let time = moment ( date ) ;
217- if ( timeZone ) {
218- time = time . tz ( timeZone ) ;
219- }
208+ const time = moment ( date )
209+ . locale ( locale )
210+ . tz ( timeZone || 'Etc/UTC' ) ;
220211 // return a locale-specific date
221212 return time . format ( formatString ) ;
222213 }
0 commit comments