It's not a secret anymore!
The moose likes JSF and the fly likes f:convertDateTIme problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "f:convertDateTIme problem" Watch "f:convertDateTIme problem" New topic

f:convertDateTIme problem

Dwijen Bhattacharjee

Joined: Mar 31, 2008
Posts: 26
I want a output like Monday,May19 2008so i use the following code

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

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

Joined: Jun 25, 2001
Posts: 17280

Try dateStyle="long". The formats are in the JavaDocs (

An IDE is no substitute for an Intelligent Developer.
Dwijen Bhattacharjee

Joined: Mar 31, 2008
Posts: 26
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 ..
I agree. Here's the link:
subject: f:convertDateTIme problem
It's not a secret anymore!