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])

Formats a datetime, date or time

Arguments:

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

Formats a datetime, date or time

Arguments:

day(timezone=[string])

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

Arguments:

dayOfWeek(timezone=[string])

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

Arguments:

dayOfWeekAsString(timezone=[string])

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

Arguments:

dayOfWeekShortAsString(timezone=[string])

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

Arguments:

dayOfYear(timezone=[string])

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

Arguments:

daysInMonth(timezone=[string])

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

Arguments:

daysInYear(timezone=[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])

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

Arguments:

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

Formats a datetime, date or time

Arguments:

getTime(timezone=[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])

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

Arguments:

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

Formats a date in a locale-specific format

Arguments:

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

Formats a date in a locale-specific format

Arguments:

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

Provides the Localized BIF and member functions for time units ( e.g.

different locales have different start days to the week )

Arguments:

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

Formats a date in a locale-specific format

Arguments:

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

Provides the Localized BIF and member functions for time units ( e.g.

different locales have different start days to the week )

Arguments:

millisecond(timezone=[string])

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

Arguments:

minute(timezone=[string])

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

Arguments:

month(timezone=[string])

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

Arguments:

monthAsString(timezone=[string])

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

Arguments:

monthShortAsString(timezone=[string])

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

Arguments:

nanosecond(timezone=[string])

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

Arguments:

offset(timezone=[string])

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

Arguments:

quarter(timezone=[string])

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

Arguments:

second(timezone=[string])

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

Arguments:

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

Formats a datetime, date or time

Arguments:

timezone(timezone=[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:

weekOfYear(timezone=[string])

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

Arguments:

year(timezone=[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