Search code examples
coldfusioncfml

CFML issue with date mask


I have this string: "{ts '2015-03-02 12:00:00'}"(variables.fl_dt) and I am trying to convert it using date format:

#DateFormat("#variables.fl_dt#", "yyyy.MM.dd 'at' HH:nn:ss")#

Everything is ok except the minutes: 2015.03.02 at 12:nn:00 On Adobe's website "nn" is for minutes but it seems that is not working here. Any ideas?


Solution

  • DateFormat does not have time pattern. Requested result can be obtained using DateFormat and TimeFormat functions.

    <cfset result = DateFormat(variables.fl_dt, "yyyy.MM.dd") & " at " &   
                    TimeFormat(variables.fl_dt, "HH:nn:ss") />