Year Function

Returns the year from a serial date number that is generated by the DateSerial or the DateValue function.

แƒกแƒ˜แƒœแƒขแƒแƒฅแƒกแƒ˜


Year (Number)

แƒ“แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ:

แƒ›แƒ—แƒ”แƒšแƒ˜ แƒ แƒ˜แƒชแƒฎแƒ•แƒ˜

Parameters:

Number: Integer expression that contains the serial date number that is used to calculate the year.

This function is the opposite of the DateSerial function, and returns the year of a serial date. For example, the expression:


Print Year(DateSerial(1994, 12, 20))

returns the value 1994.

Error codes:

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err5 not found).

แƒ›แƒแƒ’แƒแƒšแƒ˜แƒ—แƒ˜:


Sub ExampleYear
    MsgBox "" & Year(Now) ,64,"Current year"
End Sub

Please support us!