Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:08:37+00:00 2026-06-12T09:08:37+00:00

In postgres 9.2 i have a column with a timestamp CREATE TABLE pilot (

  • 0

In postgres 9.2 i have a column with a timestamp

CREATE TABLE pilot
(
  id bigint NOT NULL,
  birthdate timestamp without time zone NOT NULL,
  firstname character varying(50) NOT NULL,
  CONSTRAINT pilot_pkey PRIMARY KEY (id )
)

I inserted some rows directly with a java main with Hibernate :

    for (int i = 0; i < 10; i++) {
        Pilot p = new Pilot();
        p.setBirthdate(new Date());
        p.setFirstname("Johnson_" +tabchar[i] );
        em.persist(p);
    }

My property looks like this :

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "birthdate", nullable = false, unique = false)
public java.util.Date getBirthdate() {
    return birthdate;
}

And some rows are inserted by JSF2 relaying to hibernate :
I ‘m using JSF 2.1.13

    <h:form id="formPilot">
        <h:panelGrid columns="2">
            <h:outputLabel value="#{appMsg['pilot.firstname']}" />
            <h:inputText id="firstname" label="#{appMsg['pilot.firstname']}" value="#{pilotHolder.pilot.firstname}"
                required="true" />

            <h:outputLabel value="#{appMsg['pilot.birthdate']}" />
            <h:inputText id="birthdate" label="#{appMsg['pilot.birthdate']}" value="#{pilotHolder.pilot.birthdate}"
                required="true">
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" timeZone="GMT+1"/>
            </h:inputText>

        </h:panelGrid>
        <h:commandButton id="merge" action="#{pilotAction.doMerge}"
            value="#{pilotHolder.pilot.id ne null ? appMsg['pilot.update'] : appMsg['pilot.create']}" />
    </h:form>   

In the DB all is OK, all the dates are correct (with the hours ok)

BUT When I show the list of Pilots though and show them on a page the date which were inserted by Hibernate without JSF have an error of 1 hour less,
not the timestamps that i inserted with JSF ?

        <h:column>
            <f:facet name="header">
                <h:outputText value="#{appMsg['pilot.birthdate']}" />
            </f:facet>
            <h:outputText value="#{p.birthdate}" >
               <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" timeZone="GMT+1"/>
            </h:outputText>
        </h:column>

What is strange is that i can’t any difference in the DB using DBvisualizer, they all look similar,
If I print the date after Hibernate has fetch them, all is ok.

If i look closer at the dates inserted by Hibernate and fetched back, they contain a field cdate not null of type Gregorian$Date.
The dates inserted by JSF and fetched back have a cdate=null.

Why?
and why are they interpreted differently by JSF2 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:08:38+00:00Added an answer on June 12, 2026 at 9:08 am

    I think it is DAYLIGHT SAVING TIME related

    Try this in your web.xml

    <context-param>
        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
        <param-value>true</param-value>
    </context-param>
    

    Or you can tell the f:dateTimeConverter which timeZone to use.
    Just use a Time Zone that doesn’t use daylight savings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with a time without time zone data type in a
I have a field in my postgres database using the time (without time zone)
I have arrival column of type timestamp in table reservations ( I'm using postgres
is is possible in postgres to have a trigger on CREATE TABLE that will
I have designed a table (in postgres) where 'id' column is autoincremented via its
I have a postgres table with a column (called id) which contains strings. In
I have a table in Postgres and MySQL with a 'created_at' column. I would
I am testing Postgres insertion performance. I have a table with one column with
Let's say you have a postgres 8.3 table as follows: CREATE TABLE t1 (body
Working on postgres SQL. I have a table with a column that contains values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.