Milliseconds out of a java.util.Date that thinks it is a freemarker.template.SimpleDate

"Prinz, Tobias" <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <917264139.9124.1254734987647.JavaMail.open-xchange@ox6-unstable-2.open-xchange.com>
Hi there,

I got a set of pretty simple macros for printing out dates. One for giving only
the day, one for the time, one for timezone. These all work fine, using the
built-in features like ?string("dddd-mm-yy").

Now I try (for debugging purposes) to write one that gives me the milliseconds
since 1970 (which is not covered by built-in functions).

For a java.util.Date, this is simple, right?

wrapper.getMyDate.getTime()

So I tried a naive approach in Freemarker:

wrapper.myDate.time

Sadly, this makes the system cry out:
Expected hash. wrapper.myDate evaluated instead to
freemarker.template.SimpleDate


I wonder why that is happening.
My assumption, though I did not find anything in the docs about it: There are
obviously classes that get treated differently by FreeMarker. Some are just
wrapped, but others get special features. java.util.Date is wrapped into
freemarker.template.SimpleDate. The latter misses the former's getTime() method.
Right?
If so: How can I prevent this from happening?
If not: How else does it work, what do I need to do?
 
Thanks in advance,
Tobias

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.