DateTime Object

Top  Previous  Next

Provides static functions for manipulating date & time.

Description

In CellScript, date and time are represented as a number -- the number of seconds since midnight, January 1, 1980. The DateTime object provides functions which allow you to easily convert between date/time values and the normal date and time components (year, month, hour, etc.).

 

A date/time value is considered just a date if its time components are set to zero, which is equivalent to midnight. It is considered just a time if its date components are set to zero, which makes the value equal to the number of seconds after midnight.

Static Functions

dayName

Gets a weekday name string.

getDate

Gets the date portion from a date/time value.

getTime

Gets the time portion from a date/time value.

makeDate

Builds a date/time value from components such as year, month, day, etc.

makeTime

Builds a time value from its components hour, minute, and second.

monthName

Gets a month name string.

now

Gets the current date and time.

parse

Parses a string representing a date and/or time.

toArray

Breaks a date/time value into components such as year, month, hour, etc.

toString

Converts a date/time value to a string in a standard format.