freemarker calendar display format with time zone info
Bionicoder <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hi gurus,
I have a question about how to display java.util.calendar 's time zone in
FTL. The "time zone" I am talking about is the time zone set in calendar,
instead of the time zone set in local machine.
The problem I got is the parsed FTL always display the local machine's time
zone and the time based on the local machine time zone. It CAN NOT display
the time zone set in calendar. For example, my server's time zone setting
is America/Los Angles (PDT). One customer object has a calendar time
property whose time zone is America/new York (EDT). In web page display, it
always display the PDT time zone, instead of EDT.
The format I used in FTL is like:
<p>The customer local time is: ${cal.time?string("MM-dd-yyyy HH:mm:ss
zzz")}</p>
cal is the calendar object which has the time zone different from local
machine 's time zone.
My app is developed on EJB3, mysql, struts2, JSP + freemarker. One of
project's requirement is to display customer's time based on their own time
zone. Customer class is like:
public Class Customer extends Serializable {
private long id;
private String name;
private Calendar cal; // calendar time
......
}
Please shed some light if you can. I appreciate it.
BC
--
View this message in context: http://www.nabble.com/freemarker-calendar-display-format-with-time-zone-info-tp19719091p19719091.html
Sent from the freemarker-user mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/