rozetko
2 years ago
5 changed files with 18 additions and 7 deletions
@ -1,5 +1,9 @@ |
|||||||
import * as moment from 'moment-timezone'; |
import * as moment from 'moment-timezone'; |
||||||
|
|
||||||
|
export function toDateString(msTimestamp: number, timeZone: string): string { |
||||||
|
return moment.tz(msTimestamp, timeZone).format('YYYY-MM-DD'); |
||||||
|
} |
||||||
|
|
||||||
export function toIsoString(msTimestamp: number, timeZone: string): string { |
export function toIsoString(msTimestamp: number, timeZone: string): string { |
||||||
return moment.tz(msTimestamp, timeZone).format('YYYY-MM-DD HH:mm:ssZ').replace(/:00$/, ''); |
return moment.tz(msTimestamp, timeZone).format('YYYY-MM-DD HH:mm:ssZ').replace(/:00$/, ''); |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue