Date Formatter

Modified on Tue, 01 Nov 2022 at 11:19 AM

Date Formatter

The Date Formatter component is a wrapper around the Intl.DateTimeFormat function in JS. It takes a string in datetime format.



Custom Parameters:
    • Locale: Often the order a day, month, and year is written depends on the locale. For example, if you use en-US, which is the abbreviation for the US, your date will be written in MM/DD/YY format, but if you use en-GB, which is the abbreviation for the UK, the format will look more like DD/MM/YY. 
    • Weekday
        • Narrow: This will give a one or two letter abbreviation for the day of the week
        • Short: This will give a standard abbreviation like Mon, Tues, Wed, ect. 
        • Long: This will print out the entire name of the weekday: Monday, Tuesday, Wednesday, ect
    • Era :  
        • Narrow: This will give a one or two letter abbreviation for the Era (A or B) 
        • Short: This will give the standard abbreviation for Eras (AD, BC) 
        • Long: This will print out the entire Latin name for an era: Anno Domini
    • Year, Month, Day, Hour, Minute, Second :  
        • Numeric: This will print the full numeric representation of the respective times
        • 2-digit: This will print a two digit abbreviation for the above times
    •  timeZoneName:
        • Short: This will print the abbreviated time zone in relation to Greenwich Mean Time (GMT) 
        • Long: This will print the unabbreviated local time zone (ex: Eastern Daylight Time) 
          *timeZone: You can also overwrite this by typing your own time zone. 
    • hour12
        • Toggles between military and 12 hour time notation for the hour


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article