Whatever message this page gives is out now! Go check it out!
dateTimeFormat (date)
dateTimeFormat (date [, mask])
dateTimeFormat (date [, mask, timeZone])Parameter | Description |
date | Required. A date/time object, in the range 100 AD-9999 AD. |
mask | Optional. Characters that show how ColdFusion displays a date:
The following masks tell how to format the full date and time and cannot be combined with other masks:
The function also follows Java date time mask, except for mask a. For more information, refer to Date and Time Patterns topic in SimpleDateFormat Java API page. JDK7 and JDK8 introduces the masks w, ww , W, and WW. |
timeZone | The time-zone information. You can specify in either of the following formats:
|
<cfscript>
Date1 = "{ts '2018-11-05 12:13:50'}";
DateTimeFormat= DateTimeFormat(Date1,"m")
DateTimeFormat1= DateTimeFormat(Date1,"mm")
DateTimeFormat2= DateTimeFormat(Date1,"mmm")
DateTimeFormat3= DateTimeFormat(Date1,"mmmm")
DateTimeFormat4= DateTimeFormat(Date1,"M")
writeOutput("Month as digits; no leading zero for single-digit months: " & DateTimeFormat & "<br/>")
writeOutput("Month as digits; leading zero for single-digit months: " & DateTimeFormat1 & "<br/>")
writeOutput(" Month as a three-letter abbreviation.: " & DateTimeFormat2 & "<br/>")
writeOutput(" Month as a three-letter abbreviation.: " & DateTimeFormat3 & "<br/>")
writeOutput(" Month in year: " & DateTimeFormat4 & "<br/>")
</cfscript>