File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

f:convertDateTIme problem

 
Dwijen Bhattacharjee
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want a output like Monday,May19 2008so i use the following code

<hutputText value="#{testBean.date}" >
<f:convertDateTime type="date" dateStyle="full" />
</hutputText>

TestBean's getDate() returns new Date();
but i am getting a output like Mon May 19 19:05:47 IST 2008

how can i get the desired Output.
i also tried pattern of the <f:convetDateTime like pattern="EEEE, MMMM d, yyyy" but no luck.
please help.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try dateStyle="long". The formats are in the JavaDocs (http://java.sun.com/j2se/1.5.0/docs/api/java/text/DateFormat.html)
 
Dwijen Bhattacharjee
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
According to the JavaDocs
* SHORT is completely numeric, such as 12.13.52 or 3:30pm
* MEDIUM is longer, such as Jan 12, 1952
* LONG is longer, such as January 12, 1952 or 3:30:32pm
* FULL is pretty completely specified, such as Tuesday, April 12,
1952 AD or 3:30:42pm PST

so I have used Full.
Now my question is---
Whatever I have done Is it enough or I am missing something to add
in the code?
because I am using type="date" but still I am getting the Time &
date (which is the output of new date()).so that means it is not
converting . Plese help ..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic