Jump to content
Changes to the Jaspersoft community edition download ×

TimeZone for java.util.Date


Recommended Posts

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

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...