Year Function

Purpose

Returns an Integer specifying a whole number representing the year.

Syntax

Year(date)

date:Date exp

Description

The function Year() returns the year a Date. The result is a two digit or a four digit number, depending on the Mode Lang setting.

Example

OpenW 1

Local z As Date

z = HmsToTime(110000, 20, 4000)

Print z, Year(z)

Print Now, Year(Now)

Print Date, " ", Year(Date)

Print "12/12/1912", " ", Year(#12.12.1912#)

Print FileDateTime("c:\windows\notepad.exe"), Year(FileDateTime("c:\windows\notepad.exe"))

Remarks

See Also

CDate(), Date, Date$, DateAdd(), DateDiff(), DatePart(), DateSerial(), DateTime$(), DateToDmy, DateToDmyHms, DateValue(), Day(), DayNo(), DmyHmsToDate(), DmyToDate(), HmsToTime(), Hour(), IsDate(), Minute(), Month(), Now, Now$(), TimeSerial(), TimeToHms, TimeValue(), Second(), Week(), WeekDay(), Year()

{Created by Sjouke Hamstra; Last updated: 18/10/2014 by James Gaite}