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.
| Need | Go to |
|---|---|
| Convert only the digits | Digits |
| Show today, yesterday, or tomorrow | Relative Time |
Turn strings into Date objects | Parsing |
| Shift, clamp, or compare dates | Date Helpers |
| Reuse shared month, weekday, digit, or timezone data | Constants |
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
| Task | What to read |
|---|---|
| Localize digits inside a sentence | Digits |
| Render relative labels in feeds or notifications | Relative Time |
| Normalize user input before formatting | Parsing |
| Move a date forward or backward | Date Helpers |
| Reuse exported month and weekday data | Constants |