Skip to content

Use date formatters

Helper function for formatting days based on locale and timezone.

Get Formatted Time

Get formatted time based on h11 or h23 time preference.

ts
const { getFormattedTime } = useDateFormatters();

Get Formatted Day

Get formatted and localized day adjusted for current timezone.

e.g. Thursday

ts
const { getFormattedDay } = useDateFormatters();

Get Formatted Day In Month

Get formatted and localized day in month adjusted for current timezone. e.g. November 21

ts
const { getFormattedDayInMonth } = useDateFormatters();