Convert ISO datetime string to standard date format in Freemarker

dateformatfreemarker

How can I convert a string in an iso date format like

"2015-06-28T03:39:43.176Z" 

to look like

"2015-06-28 03:39:43 PDT" using Freemarker?

I tried some things like:

${x.Start?datetime(iso)?datetime}
${x.Start?datetime.iso?datetime}

But that didn't work.

Best Answer

You have to use the string builting to convert the datetime variable, created from your string with the datetime.iso built-in. ${"2015-06-28T03:39:43.176Z"?datetime.iso?string("yyyy-MM-dd HH:mm:ss zzz")} works for me.