Date and time

Date and time functions let you perform a variety of different tasks with date, datetime, or time data.

For example, you can calculate the number of days between two dates, extract portions of a date, such as just the month, or find out the day of the week that corresponds to each date.

Function descriptions

Function Description

AGE( )

Returns the age, in days, of a specified date compared to a specified cutoff date, or the current operating system date.

CDOW( )

Returns the name of the day of the week for a specified date or datetime. Abbreviation for "Character Day of Week".

CMOY( )

Returns the name of the month of the year for a specified date or datetime. Abbreviation for "Character Month of Year".

CTOD( )

Converts a character or numeric date value to a date. Can also extract the date from a character or numeric datetime value and return it as a date. Abbreviation for "Character to Date".

CTODT( )

Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to Datetime".

CTOT( )

Converts a character or numeric time value to a time. Can also extract the time from a character or numeric datetime value and return it as a time. Abbreviation for "Character to Time".

DATE( )

Extracts the date from a specified date or datetime and returns it as a character string. Can also return the current operating system date.

DATETIME( )

Converts a datetime to a character string. Can also return the current operating system datetime.

DAY( )

Extracts the day of the month from a specified date or datetime and returns it as a numeric value (1 to 31).

DOW( )

Returns a numeric value (1 to 7) representing the day of the week for a specified date or datetime. Abbreviation for "Day of Week".

EOMONTH( )

Returns the date of the last day of the month that is the specified number of months before or after a specified date.

GOMONTH( )

Returns the date that is the specified number of months before or after a specified date.

HOUR( )

Extracts the hour from a specified time or datetime and returns it as a numeric value using the 24-hour clock.

MAXIMUM( )

Returns the maximum value in a set of numeric values, or the most recent value in a set of datetime values.

MINIMUM( )

Returns the minimum value in a set of numeric values, or the oldest value in a set of datetime values.

MINUTE( )

Extracts the minutes from a specified time or datetime and returns it as a numeric value.

MONTH( )

Extracts the month from a specified date or datetime and returns it as a numeric value (1 to 12).

NOW( )

Returns the current operating system time as a Datetime data type.

SECOND( )

Extracts the seconds from a specified time or datetime and returns it as a numeric value.

STOD( )

Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation for "Serial to Date".

STODT( )

Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".

STOT( )

Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24 hours equaling 1 – to a time value. Abbreviation for "Serial to Time".

TIME( )

Extracts the time from a specified time or datetime and returns it as a character string. Can also return the current operating system time.

TODAY( )

Returns the current operating system date as a Datetime data type.

UTOD( )

Converts a Unicode string containing a formatted date to an Analytics date value. Abbreviation for "Unicode to Date".

WORKDAY( )

Returns the number of workdays between two dates.

YEAR( )

Extracts the year from a specified date or datetime and returns it as a numeric value using the YYYY format.

ACL Scripting Guide 14.1