|
|
|
@ -4,6 +4,7 @@ import * as _ from 'lodash';
|
|
|
|
|
import * as moment from 'moment'; |
|
|
|
|
|
|
|
|
|
const MINUTES_IN_HOUR = 60; |
|
|
|
|
const TIME_FORMAT = 'ddd MMM DD YYYY HH:mm:ss UTCZ'; |
|
|
|
|
|
|
|
|
|
export function parseTimeZone(timeZone: string): number { |
|
|
|
|
timeZone = timeZone.replace(/['|"]/g, ''); |
|
|
|
@ -23,5 +24,6 @@ export function parseTimeZone(timeZone: string): number {
|
|
|
|
|
export function toTimeZone(time: moment.MomentInput): string { |
|
|
|
|
const utcTime = moment(time).utc(); |
|
|
|
|
const timeWithOffset = utcTime.utcOffset(TIMEZONE_UTC_OFFSET); |
|
|
|
|
return timeWithOffset.format('ddd MMM DD YYYY HH:mm:ss'); |
|
|
|
|
return timeWithOffset.format(TIME_FORMAT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|