Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > Date and Time >

Year

Previous pageReturn to chapter overviewNext page

 

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