• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

f:convertDateTime substracting a day

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

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

you can search for your timezone, and put it there.
 
Yasir Qureshi
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Darkin it worked.
 
Saloon Keeper
Posts: 28418
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic