Siebel VB Language Reference > Methods Reference for Siebel VB > Date and Time Methods >

Extract Year From Date-Time Value Method


The Extract Year From Date-Time Value method returns the year component of a date and time value. It returns this value as an integer in the range of 100 through 9999. It accepts any type of date, including strings, and attempts to convert the input value to a date value.

The return value is an integer variable type. If the return value is null, then this method returns a null variable type. For more information, see Variants.

Format

Year(date)

The argument that this method uses is the same as the argument that the Convert String to Date method uses. For more information, see Convert String to Date Method.

Example

The following example returns the year for today:

Sub Button_Click
   Dim nowyear
   nowyear = Year(Now)
End Sub

Siebel VB Language Reference Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices.