Function Dates Times Class

DaysInYear

Return the number of days in the year.

Signature (Visual Basic / VBA)

Public Function DaysInYear( _
    ByVal vDate As Variant _
    ) As Variant

Code Example

    DaysInYear(1996) = 366
    DaysInYear(#2/5/1996#) = 366
    DaysInYear(2000) = 366
    DaysInYear(2001) = 365
    DaysInYear(#2/5/2001#) = 365

Parameters

Parameter Description
vDate The date or year number whose number of days is returned. Function examines the year component of the date if vDate is a date value. Function interprets numeric values as years instead of interpreting them as a date. Function returns Null if vDate is Null or cannot be fixed up to either a date or a number.