Whatever message this page gives is out now! Go check it out!
LSDateTimeFormat (date , mask)
LSDateTimeFormat (date [, mask, locale])
LSDateTimeFormat (date [, mask, locale, timezone])Parameter | Description |
date | Required. A date/time object, in the range 100 AD-9999 AD. |
mask | Optional. Mask that has to be used for formatting. See DateTimeFormat. |
timezone | The time-zone information. You can specify in either of the following formats:
|
locale | Locale to use instead of the locale of the page when processing the function. |
<cfset todayDateTime = Now()>
<body>
<h3>DateTimeFormat Example</h3>
<p>Today's date and time are <cfoutput>#todayDateTime#</cfoutput>.
<p>Using DateTimeFormat, we can display that date and time in different ways:
<cfoutput>
<ul>
<li>#DateTimeFormat(todayDateTime, "yyyy.MM.dd G 'at' HH:nn:ss z")#
<li>#DateTimeFormat(todayDateTime, "EEE, MMM d, ''yy")#
<li>#DateTimeFormat(todayDateTime, "h:nn a")#
<li>#DateTimeFormat(todayDateTime, "hh 'o''clock' a, zzzz")#
<li>#DateTimeFormat(todayDateTime, "K:nn a, z")#
<li>#DateTimeFormat(todayDateTime, "yyyyy.MMMMM.dd GGG hh:nn aaa")#
<li>#DateTimeFormat(todayDateTime, "EEE, d MMM yyyy HH:nn:ss Z")#
<li>#DateTimeFormat(todayDateTime, "yyMMddHHnnssZ", "English (UK)", "GMT")#
</ul>
</cfoutput>