Compartir a través de


MDY( ) Function

Returns the specified date or datetime expression in month-day-year format with the name of the month spelled out.

MDY(dExpression | tExpression)

Return Values

Character

Parameters

  • dExpression
    Specifies the date expression to return in month-day-year format.
  • tExpression
    Specifies the datetime expression to return in month-day-year format.

Remarks

If SET CENTURY is OFF, the character expression is returned in a month dd, yy format. If SET CENTURY is ON, the format is month dd, yyyy.

Example

The following example creates a user-defined function that returns a date with the corresponding weekday.

SET CENTURY OFF

CLEAR
? Longdate({^1998-02-16})  && Displays Monday, February 16, 98

SET CENTURY ON
? Longdate({^1998-02-16})  && Displays Monday, February 16, 1998

*** LongDate ***

FUNCTION longdate
PARAMETERS gdDate
RETURN CDOW(gdDate) + ', ' + MDY(gdDate)

See Also

DMY( ) | SET CENTURY | SET DATE