DateTime (Object)

An object that represents a date and time. Note: months are indexed at 1 for DateTimes, unlike JavaScript Date objects. Thus “1” represents January. Also see DateTime.Days and DateTime.Months.


DateTime(String dateTime) Creates a DateTime based on the string representation of a DateTime.
DateTime(Date date) Creates a DateTime from the JavaScript Date object.
DateTime(Number year, Number month, Number date) Creates a DateTime from the year, month and date.

Static Functions

Compare(DateTime dt1, DateTime dt2) Number Returns 1 if dt1 is greater than dt2, 0 if dt1 == dt2 and –1 if dt is less than dt2.
Now() DateTime Returns the current date as a DateTime object.

Static Fields

Days Object Enumeration and functions representing days of the week.
Months Object Enumeration and functions representing days of the week.
Null DateTime The value that determines a DateTime is considered "null". Default is 1/1/1900 12:00:00 AM


Property Functions

Date(Number date) Get or sets the date portion.
Hour(Number hour) Get or sets the hour portion.
Minute(Number minute) Get or sets the minute portion.
Month(Number month) Get or sets the month portion.
Second(Number second) Get or sets the second portion.
Ticks(Number ticks) Get or sets the milliseconds since January 1, 1970.
Value(Date date) Get or sets the Date object.
Year(Number year) Get or sets the year portion.


Add(TimeSpan timeSpan) DateTime Adds the timeSpan to the date, returning the resulting DateTime.
Compare(DateTime dateTime) Number If the calling DateTime is greater than the provided dateTime, returns 1, if it’s equal, returns 0, and if it’s less than, returns –1.
DayOfWeek() String Returns the day of the week as a string, which can be compared to DateTime.Days
Equals() Boolean Returns true if the DateTimes have the same Value()
GetTime() TimeSpan Returns a TimeSpan of the time portion.
Subtract(TimeSpan timeSpan) DateTime Subtracts the timeSpan from the date, returning the resulting DateTime.
ToGMTString() String Returns the GMT representation of the date
ToString() String Returns the date portion in a simple mm/dd/yyyy format.
ToString(Boolean includeTime) String If includeTime is true, includes the time portion of the string in the formation mm/dd/yy hh:mm:ss AM/PM

Last edited May 30, 2011 at 3:11 PM by dahrkdaiz, version 10


No comments yet.