Docs
Components
Dark
Light
System
Formats a given date into a time string based on the specified format, locale, and time zone.
date
Type:
Date
The date or timestamp to format.
Default:
format
"hh:mm" | "hh:mm:ss" | "hh:mm AM/PM" | "hh:mm:ss AM/PM"
The time format pattern.
locale
"en-US" | "en-GB" | "en-CA" | "en-AU" | "en-IN" | "en-NZ" | "en-ZA" | "fr-FR" | "fr-CA" | "de-DE" | "es-ES" | "es-MX" | "it-IT" | "nl-NL" | "pt-PT" | "pt-BR" | "ru-RU" | "pl-PL" | "zh-CN" | "zh-TW" | "ja-JP" | "ko-KR" | "hi-IN" | "th-TH" | "vi-VN" | "ar-SA" | "he-IL" | "tr-TR" | "fa-IR"
The locale for formatting.
replaceFormat
"" | "-" | "/" | " " | "," | ":"
Replaces delimiters in the formatted time with a custom string.
timeZone
"UTC" | "PST" | "EST" | "CST" | "MST" | "IST" | "GMT" | "CET" | "EET" | "JST" | "AEST" | "AKST" | "HST" | "AST" | "NST" | "SST" | "CHST" | "BST" | "WET" | "EAT" | "MSK" | "SAMT" | "PKT" | "ICT" | "SGT" | "CST-China" | "KST" | "AEDT" | "NZST" | "FJT" | "HKT"
The time zone to use for formatting.