2 Replies Latest reply on Jul 3, 2007 10:27 AM by kavi arasu

    Date Convert Error

    kavi arasu Newbie

      Hi i like to insert date inside oracle 10 database in the date field which i assigned field as date format.
      Tdate(date)
      <h:inputText value="#{user1.tdate}" >
      <f:convertDateTime pattern="dd-MM-yyyy"/>
      </h:inputText>
      i try to insert in 23-jun-2007 format but it giving exception
      value must be a datetime.
      can any

        • 1. Re: Date Convert Error
          Pete Muir Master

          I don't think that dd-MM-yyyy is the correct pattern for 23-jun-2007. This is just the standard Java SimpleDateFormat stuff, so take a look at that for the correct pattern :)

          • 2. Re: Date Convert Error
            kavi arasu Newbie

            hi im using the
            following code to insert date into oracle 10 database. i want the format to be saved as 11-jun1983.
            and i pasted the codings
            can you suggest is this is the correct format
            ----------------------------------------------
            public Date getTdate() {
            return this.tdate;
            }

            public void setTdate(Date tdate) {
            this.tdate = new java.sql.Date(tdate.getTime());
            }
            -----------------------------------------------------
            <h:inputText value="#{user1.tdate}">
            <f:convertDateTime pattern="MM/dd/yyyy"/>
            </h:inputText>

            im getting the following error when i enter the code
            Cannot convert 11/6/83 5:30 AM of type class java.util.Date to class java.sql.Date
            thank you