Programming Reference:Functions:CCFormatDate
From CodeCharge Studio Community Wiki
Description
Formats a date value according to the specified format mask.
Location
Common
Syntax
CCFormatDate(DateToFormat,FormatMask)
Return value
None
Parameters
| Name | Type | Description | Required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DateToFormat | Array | The date value which will be formatted | Yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FormatMask | Array of strings | Each string is one of the following components (all other components are left unchanged when building formatted value):
| Yes |
ASP
CCFormatDate(CDate("2002-05-01"),array("LongDate")) -> "May 1, 2002"
CCFormatDate(CDate("2002-05-01 20:12"),array("mmm"," ","d",", time is ","hh",":","nn","","AM/PM")) -> "May 1, time is 8:12 PM"
PHP
CCFormatDate(CCParseDate("2002 May 1",array("yyyy"," ","mmm"," ","d")), array("LongDate")) -> "May 1, 2002"
CCFormatDate(CCParseDate("2002-05-01 20:12",
array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn")),
array("mmm"," ","d",", time is ","hh",":","nn","","AM/PM")) -> "May 1, time is 8:12 PM"