Day

Use this function to get the day portion of a date as an integer.

Syntax

Day (Date, Format, Locale)

Parameter

Description

Date

Enter a date string. The system assumes your entry to be in the format specified in the Format parameter. The default is the current date.

Format

Enter a date format string that describes the contents of the Date parameter. The default is date format 1 (MM/DD/YY).

Locale

(Optional) Enter the locale code. If you omit this parameter, the system checks the Locale INI option. If the Locale INI option offers no value, the system defaults to USD (United States/English)..

The system determines the day portion of the given date based on the format you specify in the Format parameter.

Example

Here are some examples:

(Assume the current date is 07/01/09.)

Function

Result

Explanation

Return(Day( ))

1

Defaults to the current date and enters the integer 1.

datestring = DateAdd( , , 15);

Return(Day (datestring))

16

First the DateAdd function defaults to the current date and adds 15 days which results in a date of July 16, 2009. This date is returned to the target variable datestring. The date is then used by the Day function and the integer value of 16 is returned.

Return(Day("09/138", "I"))

18

The given date (09/138) in date format I is May 18, 2009. Therefore, the integer value of 18 is returned.

See also