TIMVL

TIMVL returns the numeric value of a component (year, month, etc.) of a date/time value.

This function is valid in both rules and TurboIntegrator processes.

Syntax

TIMVL(datetime, type, ExtendedYears)

Argument

Modifier and

Description

datetime

A date and time serial number.

The integer part of the number specifies the date, and the decimal part specifies the time within the day. Day number 0 corresponds to '60-01-01.' Negative numbers correspond to prior years. Years in the 21st Century, up to 2059, are represented by years 00 through 59. An hour is 1/24th of a day, a minute 1/60th of an hour, and a second 1/60th of a minute.

type

A character that specifies the type of component to be extracted. The following are valid type arguments:

 

Y

year value (1997, 1998, etc.)

 

M

month value (1 through 12)

 

D

day value (1 through 31)

 

H

hour value (0 through 23)

 

I

minute value (00 through 59)

 

S

second value (00 through 59)

ExtendedYears

This optional Boolean parameter specifies whether the function returns a date falling within the range 1960 - 2059 or 1960 - 9999.

If ExtendedYears is true, the function returns a date falling within the range of Jan. 1, 1960 and Dec. 31, 9999. Serial date 0 corresponds to Jan. 1, 1960 and serial date 2936549 corresponds to Dec. 31, 9999.

If ExtendedYears is false, or if this optional argument is omitted from the TIMVL function, the function returns a date falling within the range Jan. 1, 1960 and Dec. 31, 2059. Serial date 0 corresponds to Jan 1, 1960 and serial date 36524 corresponds to Dec. 31, 2059.

If ExtendedYears is false or is omitted and you specify a serial date greater than 36524, the serial date used by the function is determined by the formula n - 36525. For example, if you specify a serial date of 36530, then 36530 - 36525 = 5. In this case, TIMVL uses 5 as the serial date and returns the date Jan. 6, 1960.

Example

TIMVL(11111.1100, 'Y') returns 1990.

TIMVL(11111.1100, 'H') returns 2.