Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

f:convertDateTIme problem

 
Dwijen Bhattacharjee
Greenhorn
Posts: 26
  • 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: 18157
53
Android Eclipse IDE Linux
  • 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
  • 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 ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic