2 Replies Latest reply on Apr 11, 2007 1:49 PM by Baiyun Gao

    Time Zone Issue

    Baiyun Gao Newbie

      Hi there,

      I am using Seam + Facelets to develop a web application, I noticed t that the date or time displayed is different from database:

      for example: date at datebase is 04/10/2007 1:00PM
      the date displayed wiould be 04/10/2007 4:00PM
      My server is Eastern Time.

      Please Advice.

      Thanks,
      Ben

        • 1. Re: Time Zone Issue
          Adrian Mitev Master

          Could you paste your jsf code. There is a problem with f:convertDateTime converter. It doest not use the server encoding, but the default GMT.

          • 2. Re: Time Zone Issue
            Baiyun Gao Newbie

            Here is my JSF Code.

            
            
            <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:s="http://jboss.com/products/seam/taglib"
             xmlns:a="https://ajax4jsf.dev.java.net/ajax"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich"
             template="template.xhtml">
            
            
             <ui:define name="content">
             <div class="section">
             <h1>Transaction Detail</h1>
             </div>
             <div class="section">
            
             <h:form id="register">
             <fieldset>
            
             <div class="entry">
             <div class="label">Transaction Number:</div>
             <div class="output">#{transaction.txNumber}</div>
             </div>
            
             <div class="entry">
             <div class="label">Veteran SSN:</div>
             <div class="output">#{transaction.vetSSN}</div>
             </div>
            
             <div class="entry">
             <div class="label">Veteran Name</div>
             <div class="output">#{veteran.vetFirstName} #{veteran.vetLastName}</div>
             </div>
            
             <div class="entry">
             <div class="label">Date Received:</div>
             <div class="output">
             <h:outputText value="#{transaction.txDateReceived}">
             <s:convertDateTime pattern="MM/dd/yyyy"/>
             </h:outputText>
            
             </div>
             </div>
            
             <div class="entry">
             <div class="label">Date Due:</div>
             <div class="output">
             <h:outputText value="#{transaction.txDateDue}">
             <s:convertDateTime pattern="MM/dd/yyyy"/>
             </h:outputText>
            
            
             </div>
             </div>
            
             <div class="entry">
             <div class="label">Transaction Assigned:</div>
             <div class="output">#{transaction.txPersonAssigned} </div>
             </div>
            
             <div class="entry">
             <div class="label">Date Closed</div>
             <div class="output">
             <h:outputText value="#{transaction.txDateClosed}">
             <s:convertDateTime pattern="MM/dd/yyyy"/>
             </h:outputText>
             </div>
             </div>
            
             <div class="entry">
             <div class="label">Remarks:</div>
             <div class="output">#{transaction.txRemarks} </div>
             </div>
            
             <s:validateAll>
            
             <f:facet name="aroundInvalidField">
             <s:span styleClass="errors"/>
             </f:facet>
            
            
            
             </s:validateAll>
            
             <div class="entry errors">
             <h:messages globalOnly="true"/>
             </div>
            
             <div class="entry">
             <div class="label"> </div>
             <div class="input">
             <h:commandButton id="admin" value="Admin" action="#{adminbean.adminTX(transaction)}" rendered="#{sessionstatus.isSup}"/>
             </div>
             </div>
            
             </fieldset>
            
             </h:form>
            
             </div>
             <div class="section">
             <br/>
             <br/>
             Detail Transaction History
             <h:form>
             <rich:datascroller for="eventList" maxPages="20" />
             <rich:spacer height="5" />
             <rich:dataTable id="eventList" rows="5" columnClasses="col"
             value="#{txEventList}" var="txevent">
             <f:facet name="header">
             <rich:columnGroup>
             <h:column>
             <h:outputText styleClass="headerText" value="Date" />
             </h:column>
             <h:column>
             <h:outputText styleClass="headerText" value="Time" />
             </h:column>
             <h:column>
             <h:outputText styleClass="headerText" value="User" />
             </h:column>
             <h:column>
             <h:outputText styleClass="headerText" value="Operation" />
             </h:column>
             <h:column>
             <h:outputText styleClass="headerText" value="Remarks" />
             </h:column>
             </rich:columnGroup>
             </f:facet>
            
             <h:column>
             <h:outputText value="#{txevent.eventTime}">
             <f:convertDateTime dateStyle="short" pattern="MM/dd/yyyy"/>
             </h:outputText>
            
             </h:column>
            
             <h:column>
             <h:outputText value="#{txevent.eventTime}">
             <f:convertDateTime timeStyle="short" pattern="h:mm:ss a"/>
             </h:outputText>
            
             </h:column>
            
             <h:column>
             <h:outputText value="#{txevent.eventActor}" />
             </h:column>
             <h:column>
             <h:outputText value="#{txevent.eventType}" />
             </h:column>
             <h:column>
             <h:outputText value="#{txevent.eventDescription}" />
             </h:column>
            
             </rich:dataTable>
             <br/>
             <h:outputLink value="RetrieveReport" >
             <f:param name="type" value="txDetail" />
             <f:param name="tx" value="#{transaction.txNumber}" />
             <h:outputText value="Print Transaction History ->"/>
             </h:outputLink>
             </h:form>
            
             </div>
            
             </ui:define>
            
            </ui:composition>
            


            Thanks,
            Ben