Aller au contenu principal

34 documents tagués avec "DateTime"

Voir tous les tags

DateTime()

Utility class to perform datetime calculations

DateTime():day()

Returns the day of the week of the DateTime object. (Sunday is 0, Monday is 1, etc.).

DateTime():diff()

Calculates the difference between the current DateTime object and another DateTime object.

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():hour()

Returns the hour of the day of the DateTime object. (24-hour format, 0-23).

DateTime():hour()

Sets the hour of the day of the DateTime object. (24-hour format, 0-23).

DateTime():isBetween()

Checks if the current DateTime object is between two other DateTime objects (inclusive).

DateTime():isSame()

Checks if the current DateTime object is the same as another DateTime object.

DateTime():local()

Converts the DateTime object's timezone to the system's default local timezone.

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():tz()

Sets the DateTime object's timezone to a specified timezone ID.

DateTime():unix()

Returns the Unix timestamp (seconds since Unix epoch) of the DateTime object.

DateTime():valueOf()

Returns the primitive value of the DateTime object, which is the number of milliseconds since the Unix epoch.