TimeZone for java.util.Date

By: Mike Warne - mwarne
TimeZone for java.util.Date
2002-08-30 10:09
Hi,

Is there a built-in way to set the Timezone for date displays? I would like to allow user to change TZ before report is generated..

Thanks,
Mike.


By: Teodor Danciu - teodord
RE: TimeZone for java.util.Date
2002-09-02 00:54

Hi,

The report text fields have a pattern attribute that
help you format the displayed information.
For java.util.Date fields, the engine uses
a SimplaDateFormat object with the specified
pattern, but in the default locale.

You can give up using this pattern attribute if it
does not suit your need and you can instantiate
yourself a SimpleDateFormat object on the fly,
in the text field expression.
You could set to it a different time zone.

In order to improve performance, you could declare
the SimpleDateFormat object only once, at report
level, using a report variable or supply it as a report
parameter.
Then you format all your text fields using it.

Thank you,
Teodor
2001 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:26am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback
randomness