You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ganesh Surisetty <sg...@gmail.com> on 2007/08/07 09:33:48 UTC

Date Display issue

Hi,

            i need to display a date from the data base, i am printing on a
jsp  with <h:outputText , it is displaying wrong date, displaying one day
less, means it is actually 3-jul-07 but it is showing 2-Jul-07 in the front
end.

can any one tell me the solution ...
Thanks in Advance.

Re: Date Display issue

Posted by Volker Weber <v....@inexso.de>.
Hi,

see this link:
http://www.mail-archive.com/users%40myfaces.apache.org/msg21412.html


Regards,
    Volker

2007/8/7, Ganesh Surisetty <sg...@gmail.com>:
> Hi,
>
>             i need to display a date from the data base, i am printing on a
> jsp  with <h:outputText , it is displaying wrong date, displaying one day
> less, means it is actually 3-jul-07 but it is showing 2-Jul-07 in the front
> end.
>
> can any one tell me the solution ...
> Thanks in Advance.

Re: Date Display issue

Posted by simon <si...@chello.at>.
On Tue, 2007-08-07 at 13:03 +0530, Ganesh Surisetty wrote:
> Hi,
>  
>             i need to display a date from the data base, i am printing
> on a jsp  with <h:outputText , it is displaying wrong date, displaying
> one day less, means it is actually 3-jul-07 but it is showing 2-Jul-07
> in the front end.
>  
> can any one tell me the solution ...
> Thanks in Advance.

See the FAQ on the myfaces wiki:
  http://wiki.apache.org/myfaces/FAQ#Date



Re: Date Display issue

Posted by David Delbecq <de...@oma.be>.
You are probably using the wrong timezone.

Experience from oracle here:

oracle store date with hour,minutes, seconds,milliseconds stripped (date
!= timestamp)
oracle send the date to java oracle connector (eg "3 jul 2007")
connector takes the default jvm timezone (eg:GMT+5) and convert to a
java.util.Date (eg 3 jul 2007 00:00 GMT+5 = 2 jul 2007 19:00 GMT)
outputText takes the timestamp and does its output based on default JSF
timezone and the pattern it was given (eg 2 jul 2007)

I recommand you use a constant timezone everywhere, starting from the
jvm, ending to user interfaces. Here, we set the JVM to Europe/Brussels,
all inputCalendars to Europe/Brussels and all outputText to Europe/Brussels.
Without setting it in jvm too, we had the issue that datas were saved in
DB one day prior, reloaded as is, reput in calendar one day prior, saved
a second day prior and so on.

To set jvm timezone:
JAVA_OPTS="-Duser.timezone=Europe/Brussels $JAVA_OPTS"
in catalnia.sh for tomcat :)


En l'instant précis du 07/08/07 09:33, Ganesh Surisetty s'exprimait en
ces termes:
> Hi,
>  
>             i need to display a date from the data base, i am printing
> on a jsp  with <h:outputText , it is displaying wrong date, displaying
> one day less, means it is actually 3-jul-07 but it is showing 2-Jul-07
> in the front end.
>  
> can any one tell me the solution ...
> Thanks in Advance.


-- 
http://www.noooxml.org/