ποΈ 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.
ποΈ DateTime():isBefore()
Checks if the current DateTime object is before another DateTime object.
ποΈ DateTime():isSame()
Checks if the current DateTime object is the same as another DateTime object.
ποΈ DateTime():isSameOrAfter()
Checks if the current DateTime object is the same as or after another DateTime object.
ποΈ DateTime():isSameOrBefore()
Checks if the current DateTime object is the same as or before another DateTime object.
ποΈ DateTime():isBetween()
Checks if the current DateTime object is between two other DateTime objects (inclusive).
ποΈ DateTime():diff()
Calculates the difference between the current DateTime object and another DateTime object.
ποΈ DateTime():utc()
Converts the DateTime object's timezone to UTC.
ποΈ DateTime():local()
Converts the DateTime object's timezone to the system's default local timezone.
ποΈ DateTime():tz()
Sets the DateTime object's timezone to a specified timezone ID.