Developer Documentation Library > Scripting > UNICOM Intelligence Function Library > Date and time functions > Day
 
Day
Returns a whole number between 1 and 31, inclusive, representing the day of the month.
Syntax
Day(Val)
Parameters
Val
Type: Date
The date for which you want to return the day.
(return)
Type: Long
The day of the month (1 to 31).
Remarks
This is equivalent to DatePart("d", Val).
Example
This example uses the Day function to return the day of the month from the current date (which is in turn returned by the Now function). For example, on 31 January 2023, this example returns 31.
Day(Now())
The following example uses the Day function to return the day stored in the DataCollection.FinishTime system variable.
DataCollection.FinishTime.Day()
See also
DateAdd
Date and time functions