datepattern(
DATE
,
PATTERN
)

The datepattern( function converts a number representing a date into text. The function uses a pattern to control how the date is formatted (see Date Patterns).


Parameters

This function has two parameters:

date – is the number you want to convert to text. This number is treated as the number of days since January 1, 4713 B.C.

pattern – is text that contains a pattern for formatting the date (see Date Patterns).


Description

This function converts a number representing a date into text. The function uses a pattern to control how the date is formatted (see Date Patterns).

datepattern(today(),"mm/dd/yy") ☞ 8/9/12
datepattern(today(),"MM/DD/YY") ☞ 08/09/12
datepattern(today(),"mm/dd/yyyy") ☞ 8/9/2012
datepattern(today(),"Month ddnth, yyyy") ☞ August 9th, 2012
datepattern(today(),"dd-MON-yy") ☞ 9-AUG-12
datepattern(today(),{DayOfWeek, Month ddnth, yyyy}) ☞ Thursday, August 9th, 2012
datepattern(today(),{Qtr "Quarter" yyyy}) ☞ 3rd Quarter 2012
datepattern(today(),"YYYYMMDD") ☞ 20120809

You can even use datepattern( to change an existing date pattern into something else.

thedate="7/4/1776"
message datepattern(date(thedate),"DayOfWeek, Month ddnth, yyyy")
    ☞ "Thursday, July 4th, 1776"

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0