DateTime()
Utility class to perform datetime calculations
DateTime():format()
Returns the formatted date as a string.
DateTime():toISOString()
Returns the ISO 8601 formatted date string (e.g., "1970-01-01T0000.000Z").
DateTime():year()
Returns the year of the DateTime object.
DateTime():month()
Returns the month of the DateTime object. (1-based, January is 1).
DateTime():add()
Adds a specified amount of time to the DateTime object.
DateTime():date()
Returns the day of the month of the DateTime object.
DateTime():day()
Returns the day of the week of the DateTime object. (Sunday is 0, Monday is 1, etc.).
DateTime():hour()
Returns the hour of the day of the DateTime object. (24-hour format, 0-23).
DateTime():minute()
Returns the minute of the hour of the DateTime object.
DateTime():second()
Returns the second of the minute of the DateTime object.
DateTime():millisecond()
Returns the millisecond of the second of the DateTime object.
DateTime():valueOf()
Returns the primitive value of the DateTime object, which is the number of milliseconds since the Unix epoch.
DateTime():unix()
Returns the Unix timestamp (seconds since Unix epoch) of the DateTime object.
DateTime():year()
Sets the year of the DateTime object.
DateTime():month()
Sets the month of the DateTime object. (1-based, January is 1).
DateTime():date()
Sets the day of the month of the DateTime object.
DateTime():hour()
Sets the hour of the day of the DateTime object. (24-hour format, 0-23).
DateTime():minute()
Sets the minute of the hour of the DateTime object.
DateTime():second()
Sets the second of the minute of the DateTime object.
DateTime():millisecond()
Sets the millisecond of the second of the DateTime object.
DateTime():subtract()
Subtracts a specified amount of time from the DateTime object.
DateTime():startOf()
Sets the DateTime object to the start of a specified unit of time (e.g., start of the day, start of the month).
DateTime():endOf()
Sets the DateTime object to the end of a specified unit of time (e.g., end of the day, end of the month).
DateTime():isAfter()
Checks if the current DateTime object is after another DateTime object.