Jump to content

Date Format Change using XML Datasource


ramandeep1980

Recommended Posts

Hi,

I am having some major trouble in changing Date format in ireport.

I am geting data from XML datasource as- 2013-02-13T22:07:37.589-05:00 and I want to change it to this 30-Feb-13 10:07 PM EST.

But some how jasper is not able to understand the incoming format from XML.

Regards,

Raman Deep Singh

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi Raman,

although I do not understand your whole date string, you should s.th. like the following: configure your xml datasource with a date pattern:

yyyy-MM-dd'T'HH:mm:ss.SSS

if the 'T' means s.th. special (I don't know) replace it with the according character from the patterns: http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html

Problematic - as far as I can see - is the timezone, because it's not standard; it should be either "PMT-05:00" => z or "-0500" => Z. Like this, you only can leave it away.

Set the field in the report as java.util.Date, insert into text field with pattern:

dd-MMM-yy hh:mm aaa

(again, leaving away the timezone)

Hope this helps,

Cheers, Thomas

http://www.thomaszimmer.net

Link to comment
Share on other sites

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...