Year

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > BuiltIn Functions > Date and Time >

Year

 

Description

 

Extracts year from string containing DD/MM/YYYY pattern

If used without parameter, returns current year directly.

 

Syntax

 

n = Year[(DateTimeStamp)]

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

DateTimeStamp

String

Yes

Value containing DD/MM/YYYY pattern

 

Remarks

 

Restrictions

 

The passed DateTimeStamp must follow the mentioned signature, otherwise incorrect result can be returned.

 

See also

 

Now, Month, Day, Hour, Minute, Second

 

Examples

 

 

 

Long currentYear = Year(Now)

Long yearFromString = Year("Thinking of 12/06/2015...")

Long currentYearDirect = Year