Time and Date Functions

Function

Returns

CurrentDateTime

Returns a DateTime variable or Time variable that contains the current local time.

Date

Returns the passed value as a date.

DateAddDay

Adds or subtracts a given number of days to or from a given DateTime variable.

DateAddHour

Adds or subtracts a given number of hours to or from a given DateTime variable.

DateAddMillisecond

Adds or subtracts a given number of milliseconds to or from a given DateTime variable.

DateAddMinute

Adds or subtracts a given number of minutes to or from a given DateTime variable.

DateAddMonth

Adds or subtracts a given number of months to or from a given DateTime variable.

DateAddSecond

Adds or subtracts a given number of seconds to or from a given DateTime variable.

DateAddYear

Adds or subtracts a given number of years to or from a given DateTime variable.

DateGetDay

Returns the day of the month component of the given DateTime variable.

DateGetDayOfWeek

Returns the day of the week of the given DateTime variable where Sunday is considered the first day of the week.

DateGetDayofWeek_WDS

Returns the day of the week for the passed DateTime value and starting week day.

DateGetDayofWeekISO

Returns the day of the week for the passed DateTime value where Monday is considered the first day of the week.

DateGetDayOfYear

Returns the day of the year of the given DateTime variable.

DateGetHour

Returns the hour component of the given DateTime variable.

DateGetMillisecond

Returns the Millisecond component of the given DateTime variable.

DateGetMinute

Returns the Minute component of the given DateTime variable.

DateGetMonth

Returns the Month component of the given DateTime variable.

DateGetSecond

Returns the Second component of the given DateTime variable.

DateGetWeekOfYear

Returns the week of the year for the passed DateTime value.

DateGetWeekOfYearISO

Returns the week of the year for the passed DateTime value using the ISO 8601 standard.

DateGetWeekOfYear_WDS

Returns the week of the year for the passed DateTime value and starting week day.

DateGetYear

Returns the Year component of the given DateTime variable.

DateGetYearOfWeekISO

Returns the year of the week that the given DateTime value's week number falls into.

DateSet

Returns a DateTime variable comprised of the passed year, month and day.

DateSetDay

Returns a new DateTime value equal to the passed DateTime with its day adjusted to the passed Day value.

DateSetHour

Returns a new DateTime value equal to the passed DateTime with its hour adjusted to the passed Hour value.

DateSetMillisecond

Returns a new DateTime value equal to the passed DateTime with its Milliseconds adjusted to the passed Milliseconds value.

DateSetMinute

Returns a new DateTime value equal to the passed DateTime with its minute adjusted to the passed Minute value.

DateSetMonth

Returns a new DateTime value equal to the passed DateTime with its month adjusted to the passed Month value.

DateSetSecond

Returns a new DateTime value equal to the passed DateTime with its seconds adjusted to the passed Seconds value.

DateSetYear

Returns a new DateTime value equal to the passed DateTime with its year adjusted to the passed Year value.

IsDateValid

Returns a Boolean value of 0 if the date is invalid, or 1 if the date is a valid date.

IsNullDateTime

Returns True if the value of the DateTime variable is null.

IsTimeSpanValid

Returns True if the passed TimeSpan variable is valid.

IsTimeValid

Returns True if the passed Time variable is valid

NullDateTime

Used to "clear" a DateTime variable. It moves a null value into a DateTime variable.

SpanAddDay

Adds or subtracts a given number of days to or from a given TimeSpan variable.

SpanAddHour

Adds or subtracts a given number of hours to or from a given TimeSpan variable.

SpanAddMillisecond

Adds or subtracts a given number of milliseconds to or from a given TimeSpan variable.

SpanAddMinute

Adds or subtracts a given number of minutes to or from a given TimeSpan variable.

SpanAddSecond

Adds or subtracts a given number of seconds to or from a given TimeSpan variable.

SpanDays

Returns the Days component of the given TimeSpan variable.

SpanHours

Returns the Hours component of the given TimeSpan variable.

SpanMilliseconds

Returns the Milliseconds component of the given TimeSpan variable.

SpanMinutes

Returns the Minutes component of the given TimeSpan variable.

SpanSeconds

Returns the Seconds component of the given TimeSpan variable.

SpanTotalDays

Calculates the total number of days in the time span and returns a double precision real number of that amount.

SpanTotalHours

Calculates the total number of Hours in the time span and returns a double precision real number of that amount.

SpanTotalMilliseconds

Calculates the total number of Milliseconds in the time span and returns a double precision real number of that amount.

SpanTotalMinutes

Calculates the total number of Minutes in the time span and returns a double precision real number of that amount.

SpanTotalSeconds

Calculates the total number of Seconds in the time span and returns a double precision real number of that amount.