在Freemarker中将ISO datetime字符串转换为标准日期格式

Geo*_*ndo 6 format freemarker date

如何转换iso日期格式的字符串,如

"2015-06-28T03:39:43.176Z" 
Run Code Online (Sandbox Code Playgroud)

看起来像

"2015-06-28 03:39:43 PDT" using Freemarker?
Run Code Online (Sandbox Code Playgroud)

我试过一些像:

${x.Start?datetime(iso)?datetime}
${x.Start?datetime.iso?datetime}
Run Code Online (Sandbox Code Playgroud)

但那没用.

小智 7

您必须使用构建string来转换使用datetime.iso内置函数从字符串创建的datetime变量.${"2015-06-28T03:39:43.176Z"?datetime.iso?string("yyyy-MM-dd HH:mm:ss zzz")}适合我.