Returns a custom-formatted time value. If no mask is specified, returns a time value using the hh:mm tt format. For international time formatting, see LSTimeFormat.
TimeFormat(time [, mask ])
CreateTime,
Now,
ParseDateTime
When passing a date/time value as a string, enclose it in quotes. Otherwise, it is interpreted as a number representation of a date/time object.
<!--- This example shows the types of output with TimeFormat ---> <html> <head> <title> TimeFormat Example </title> </head> <cfset todayDate = #Now()#> <body> <H3>TimeFormat Example</H3> <P>Today's date is <cfoutput>#todayDate#</cfoutput>. <P>Using Timeformat, we can display the value in different ways: <cfoutput> <UL> <LI>#TimeFormat(todayDate)# <LI>#TimeFormat(todayDate, "hh:mm:ss")# <LI>#TimeFormat(todayDate, "hh:mm:sst")# <LI>#TimeFormat(todayDate, "hh:mm:sstt")# <LI>#TimeFormat(todayDate, "HH:mm:ss")# </UL> </cfoutput> </body> </html>