rozetko
2 years ago
6 changed files with 19 additions and 8 deletions
@ -1,5 +1,9 @@
|
||||
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 { |
||||
return moment.tz(msTimestamp, timeZone).format('YYYY-MM-DD HH:mm:ssZ').replace(/:00$/, ''); |
||||
} |
||||
|
Loading…
Reference in new issue