Date Format dd/mm/yyyy

By: Bruno - acvbruno
Date Format dd/mm/yyyy
2003-05-31 05:02
Hi,
the date format printing in the report is some thing like this.
Sat May 31 17:26:17 GMT+05:30 2003
Is it possible to change the date to formats like mm/dd/yyyy, mm/dd/yy etc. If Possible how to change that in Ireport. Please help me in detail.

regards
bruno




By: Giulio Toffoli - gt78
RE: Date Format dd/mm/yyyy
2003-05-31 05:09
Off course.
For this porpouse, use the pattern field of your textfield. Set the class of the field to java.util.Date
and insert in the pattern field the string

mm/dd/yyyy (or dd/mm/yyyy)

Giulio




By: Bruno - acvbruno
RE: Date Format dd/mm/yyyy
2003-05-31 05:23
hi,
Thanx it worked

regards
bruno
ktrinad's picture
1157
Joined: Aug 9 2006 - 2:36am
Last seen: 16 years 2 months ago

7 Answers:

then how can i change it when the date format inside of a chart? like pie chart?
Post edited by: kelly, at: 2007/06/28 19:22
kelly's picture
1116
Joined: Jun 26 2007 - 4:12am
Last seen: 15 years 3 months ago
then how can i change it
when the date format is
inside of a chart?
like a pie chart?
Post edited by: kelly, at: 2007/06/28 19:21
kelly's picture
1116
Joined: Jun 26 2007 - 4:12am
Last seen: 15 years 3 months ago
i mean how can i change
chart's data format? there
is no pattern there.:unsure:
Post edited by: kelly, at: 2007/06/28 19:30
kelly's picture
1116
Joined: Jun 26 2007 - 4:12am
Last seen: 15 years 3 months ago
in your text field right click and open property there pettern wil be there.
use dd/MM/yy or any it will display date accoding to given pattern

Hope it will help you.

Regards:
Ritesh Kumar
singhipst's picture
548
Joined: May 13 2007 - 8:28pm
Last seen: 15 years 4 months ago
right. thank you very much for the reply.
but text field pattern is not what i'm
looking for, i'm looking for the pattern for
the date format inside of the chart.
i want the category expession to be date, but it will show "2007-06-28 00:00:00.0".
that is too long for me, so that's why i want to change the format.
http://www.jfree.org/jfreechart/images/DualAxisDemo1.png
like the "category" on this chart. the best is to be diagonal, so it can show the whole date.
Post edited by: kelly, at: 2007/06/29 21:19
kelly's picture
1116
Joined: Jun 26 2007 - 4:12am
Last seen: 15 years 3 months ago
new SimpleDateFormat("dd/MM/yyyy").format($F{yourdatefield})


or preformat the date as a string in your source query like this oracle example:


select to_char(myDateField,'DD/MM/YYYY') as formattedDate ....
jmurray's picture
3981
Joined: Dec 11 2006 - 11:19am
Last seen: 15 years 10 months ago

Select the field to which you want to format data.

Click on properties 

In properties, you will see a text field with a label called Pattern Expression

Write your format Ex: "dd/mm/yyyy"; OR  "mm/dd/yyyy"

for more info. check my attachment

 

 

Attachments: 
AttachmentSize
Image icon JasperDatePattern Format30.75 KB
prakashk827's picture
Joined: Mar 7 2020 - 1:11am
Last seen: 8 months 2 weeks ago
Feedback
randomness