jquery - Adding timezone in datetime -
jquery - Adding timezone in datetime -
following freemarker code, using parse dates , display in friendly dates, 1h ago, yesterday, lastly month etc. working fine, when compared output actual results, parsing results wrongly, i.e. time "2014-06-19t22:07:33+00:00" should show 11h ago, showing 2h ago, think issue 3rd line below in code, need pass timezone well, can please help me in how that, tried +zz:zz in end, didn't work.
<#include "relativetime.ftl" /> <#assign time = "2014-06-19t22:07:33+00:00"> <#assign posttimeobject = time?datetime("yyyy-mm-dd't'hh:mm:ss") /> //i think need pass timezone, how? <#assign posttimestring = relativetime(posttimeobject) /> ${posttimestring}
prints: 2h ago
freemarker uses java's standard date formatter (http://docs.oracle.com/javase/7/docs/api/java/text/simpledateformat.html), pattern want "yyyy-mm-dd't'hh:mm:ssx"
.
(btw, approach of template bit suspicious. can't utilize date
objects, instead of converting string
-s date
-s?)
jquery date freemarker
Comments
Post a Comment