dateTimeFormat
dateTimeFormat¶
dateTimeFormat provides utilities for date and time formatting, calculations, and comparisons.
It is useful for working with timestamps, scheduling logic, and displaying dates in a human-readable format.
dateTimeFormat is available through the Libs instance.
Get Current Date and Time¶
Get the current date/time using a custom format mask.
This returns the current date formatted as a string.
Add Days to a Date¶
You can add days to a given date.
This returns a new date object representing a future date.
Get Time Difference¶
Calculate the difference between two dates.
This returns the time difference between the two dates.
Notes¶
- Supports custom date masks
- Works with both strings and Date objects
- Useful for scheduling, cooldowns, and expiration logic