datetime

The primary DateTime class that represents a date and time object in BoxLang

All temporal methods in BoxLang operate on this class and all castable date/time representations are cast to this class

Datetime Methods

add(datepart=[string], number=[long])

Modifies a date object by date part and integer time unit

Arguments:

clone()

compare(date2=[any], datepart=[string])

Compares the difference between two dates - returning 0 if equal, -1 if date2 is less than date1 and 1 if the inverse

Arguments:

compareTo(date2=[any], datepart=[string])

Compares the difference between two dates - returning 0 if equal, -1 if date2 is less than date1 and 1 if the inverse

Arguments:

dateFormat(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

dateTimeFormat(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

day(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

dayOfWeek(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

dayOfWeekAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

dayOfWeekShortAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

dayOfYear(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

daysInMonth(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

daysInYear(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

diff(datepart=[string], date2=[any])

Returns the numeric difference in the requested date part between two dates

Arguments:

equals(obj=[any])

Indicates whether some other object is "equal to" this one.

Arguments:

firstDayOfMonth(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

format(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

getnumericdate(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

getTime(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

hash(algorithm=[string], encoding=[string], numIterations=[integer])

Creates an algorithmic hash of an object

Arguments:

hour(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

millisecond(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

minute(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

month(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

monthAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

monthShortAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

nanosecond(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

offset(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

quarter(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

second(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

timeFormat(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

timezone(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

toEpoch()

Returns this date time in epoch time ( seconds )

toEpochMillis()

Returns this date time in epoch milliseconds

toEpochSecond()

toISOString()

Returns the date time representation as a string in the specified format mask

toODBCDate(timezone=[string])

Creates a DateTime object with the format set to ODBC Implicit format

Arguments:

toODBCDateTime(timezone=[string])

Creates a DateTime object with the format set to ODBC Implicit format

Arguments:

toODBCTime(timezone=[string])

Creates a DateTime object with the format set to ODBC Implicit format

Arguments:

week(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

year(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Examples

Last updated

Logo

Copyright & Register Trademark by Ortus Solutions, Corp & Ortus Software, LLC