Re: Freemarker Date Format issue
Daniel Dekany <[email protected]> Mon, 2 Mar 2015 22:22:39 +0100
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
There are a few mistakes in that pattern... should be:
EEE, d MMM yyyy HH:mm:ss Z
Also, because EEE is language dependent, be sure your locale setting
is English. If you aren't sure about that, better start the template
with something like:
<#setting locale="en_US">
Last not least, if there's any remote chance, tell whoever generates
that XML to use ISO 8601, or better yet, xs:dateTime format (in which
case you will use ?datetime.iso or ?datetime.xs, respectively).
--
Thanks,
Daniel Dekany
Monday, March 2, 2015, 4:30:24 PM, FOX427 wrote:
> Hi All, I am getting date from xml node in this format: Mon, 02 Mar 2015
> 14:35:47 +0000.
> I need to present this as March 2, 2015. So I tried this:
>
> <#assign publishedDate=item.pubDate?datetime("a, d MMM yyyy hh:mm:ss zzz")>
> ${publishedDate?string("yyyy")}<br>
>
> So as you can see, I just wanted to extract year first and if it works I
> would add day and month. But it is giving me error message: Unparseable
> date: "Mon, 02 Mar 2015 14:35:47 +0000". It seems I am actually having the
> date value but unable to parse it, can someone give me some advice how to do
> it correctly? Thank you in advance.
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Freemarker-Date-Format-issue-tp4655381.html
> Sent from the freemarker-user mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/