Syntax
object {
date,
zoneId?
}
Properties
date: number | Date
- Timestamp or Date value, representing milliseconds since Jan 1 1970 at midnight UTC.
zoneId?: string
- IANA tzdb zone identifier, defaults to
'UTC'
Example
const cldr = framework.get('en');
let time: ZonedDateTime = { date: -6105991722000, zoneId: 'America/New_York' };
log(cldr.Calendars.formatDate(time, { date: 'full' }));
Thursday, July 4, 1776
const cldr = framework.get('en');
const day = 86400 * 1000;
const epoch = -12219223722000;
let time: ZonedDateTime = { date: epoch - day, zoneId: 'Europe/Rome' };
let result = cldr.Calendars.formatDate(time, { date: 'full' });
log(result);
time = { date: epoch, zoneId: 'Europe/Rome' };
result = cldr.Calendars.formatDate(time, { date: 'full' });
log(result);
Thursday, October 4, 1582
Friday, October 15, 1582