• Post Reply Bookmark Topic Watch Topic
  • New Topic

f:convertDateTime substracting a day  RSS feed

 
Yasir Qureshi
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am very confused I have date input on a page and using <f:convertDateTime> for conversion on my bean one day is subtracting from the date user enters.
If user enters 02/01/2009, it is changed to 01/31/2009. Is this a bug with this tag. Comments/Suggestions/workaround?

Thanks.
 
yigit darcin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yasir Qureshi wrote:I am very confused I have date input on a page and using <f:convertDateTime> for conversion on my bean one day is subtracting from the date user enters.
If user enters 02/01/2009, it is changed to 01/31/2009. Is this a bug with this tag. Comments/Suggestions/workaround?

Thanks.


you have to enter your timeZone to fix this: an example would be:

<hutputText value="#{fax.date}" >
<f:convertDateTime timeZone="Turkey"/>
</hutputText>

you can search for your timezone, and put it there.
 
Yasir Qureshi
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Darkin it worked.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to make it clear. If you don't explicitly provide a timezone, the displayed date is based on UTC. And when it's 3 am in Greenwich, England, it's still evening in New York.
 
Kiran Kodandoor
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use

the seam taglib. This doesn't have the bug that JSF tag has. If you use this taglib you needn't specify the default timezone.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!