Module
Contents
Index 🔎︎
\<bookmark_value\>Day function\</bookmark_value\>

# Day Function

Returns a value that represents the day of the month based on a serial date number generated by \<emph\>DateSerial\</emph\> or \<emph\>DateValue\</emph\>.

## Syntax:

    Day (Number)

## Return value:

Integer

## Parameters:

\<emph\>Number:\</emph\> A numeric expression that contains a serial date number from which you can determine the day of the month.

This function is basically the opposite of the DateSerial function, returning the day of the month from a serial date number generated by the \<emph\>DateSerial\</emph\> or the \<emph\>DateValue\</emph\> function. For example, the expression

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

returns the value 20.

## Error codes:

5 Invalid procedure call

## Example:

    Sub ExampleDay
        Print "Day " & Day(DateSerial(1994, 12, 20)) & " of the month"
    End Sub