Function Day() Foundation

Returns the day of a date value as a numeric value.

Syntax
Day( <dDate> ) --> nDayOfMonth
Parameters
<dDate>
<dDate> is a date expression for which the day of the month is determined.
Return

The function Day() returns an integer numeric value in the range of 0 to 31. Leap years are taken into consideration. When the date argument is February 29 and the year is not a leap year or when <dDate> is empty, Day() returns the value zero.

Description

A date value is converted to the numeric calender day with the function Day(). The function is used together with the CMonth() and Year() for formatting dates. It is also frequently used in date calculations.

Examples
Day()
// The example shows various results of the function Day() 

PROCEDURE Main 

   ? Date()                         // result: 12/06/94 
   ? Day(Date())                    // result: 6 
   ? Day(Date()) + 18               // result: 24 
   ? Day(CtoD("02/29/94"))          // result: 0 

RETURN 
Display formatted calender day

// In this example a date value is formatted with 
// functions Day(), CMonth() and Year(): 

PROCEDURE Main 

   ? CMonth( Date() )              + " "  + ; 
     LTrim(Str(Day( Date() ), 2 )) + ", " + ; 
     Str(Year( Date() ))            // result:  December 6, 1994 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.