aspose file tools*
The moose likes JSF and the fly likes Precision error in converter property of <h:outputText> tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Precision error in converter property of <h:outputText> tag?" Watch "Precision error in converter property of <h:outputText> tag?" New topic
Author

Precision error in converter property of <h:outputText> tag?

Fezekile Futhwa
Greenhorn

Joined: Aug 03, 2011
Posts: 5
Hi.

I have a date object that I am trying to render using the <hutputText> tag. Since the object contains the full date/time string, I am formatting using the converter property(converter="javax.faces.DateTime").

But the resulting date is a day before the actual date! Tracing this I have found that the converter property calculates the day as starting from 00:00:01 and not 00:00:00 as is standard in Java.

I am curious to find out if this is an error or intentional behaviour?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

As far as I'm aware, the dateTime converter is employing only the standard conversion methods of the java.util.Date and Calendar classes.

One thing that bites a lot of people regarding the day, however, is that the internal date object itself is usually based on the GMT timezone (UTC). Which means that you'll usually have to localize it. This is extra fun in webapps, since the server could be on Beruit time (usually with a UTC system clock), one user could be in New York, and another could be in Shanghai. JSF doesn't attempt to deduce the client's timezone, so you have to provide it in the converter definition.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Precision error in converter property of <h:outputText> tag?