Tarikh
Utilities

Utilities

Find the helper you need for digits, relative time, parsing, date math, and shared constants.

Start Here

Use this section when you already have a date and need a focused helper instead of a formatter.

NeedGo to
Convert only the digitsDigits
Show today, yesterday, or tomorrowRelative Time
Turn strings into Date objectsParsing
Shift, clamp, or compare datesDate Helpers
Reuse shared month, weekday, digit, or timezone dataConstants

Quick Rule

If the result should still be a date string, use format().

If you need a Date object from input text, use parseDate().

If you need date math or comparisons, use the date helpers.

Common Paths

TaskWhat to read
Localize digits inside a sentenceDigits
Render relative labels in feeds or notificationsRelative Time
Normalize user input before formattingParsing
Move a date forward or backwardDate Helpers
Reuse exported month and weekday dataConstants

On this page