Standard built-ins
Intl.DateTimeFormat.prototype.format()
Bound function that formats a date or timestamp. Omitted argument uses current time; supply a fixed instant for deterministic results.
Formal Syntax & Structure
javascript syntaxjavascript
formatter.format([date])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| date | Date | Number | Instant to format. |
Return Value
String
Localized date/time text.
Working Example
Example Snippetjavascript
const f=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",day:"numeric"});console.log(f.format(0));