java.sql.Date is not a real date

These are some readers' responses. Read the full article to see what all the fuss is about.

24 responses

Other comment pages: « 1 [2]

  • Hi,

    I wanted to know what are the main differences between the java versions 1.3.0 and 1.4.1 or later especially in case of java.util.Date.
    In our application previously we were using the java version1.3.0 now we are planning to go for java version1.4.1or later. Is there any code impact on the previous version.

    Soori | 21 September 2006
  • Soori, the Java SDKs contain the library source code. You can compare them yourself to find out all the differences.

    Bennett | 22 September 2006
  • Great Job! Very Helpful!

    W. Paul Caligiuri | 7 October 2006
  • Very good work. Saved my time.

    Mike Mountrakis | 28 November 2006
  • Thanks for the terse and thorough work!

    falco | 1 December 2006
  • Thanks very much for posting this information. It was really helpful.

    Caroline | 9 December 2006
  • I will input data in oracle.

    java.sql.Date object,

    but, java.sql.Date is “2007-01-02″,

    I hope input in oracle, java.sql.Date is “2007-01-02 23:12:50″.

    spider | 2 February 2007
  • When I convert java.util.Date into java.sql.Date how can I set a default time other than midnight? Specifically, I know that I need to set 12:00 noon. Must I ireriate over every row, or can I set a default?

    Thanks in advance.

    What is SQL? | 22 May 2007
  • Very good explanation ! Saved me a lot of grief

    echelon | 8 August 2007
  • Thank you thank you thank you for posting this!!! I had really been struggling with that. You are a lifesaver!

    Paul Butler | 19 August 2007
  • Thanks a lot for this posting! It saved me a lot of time trying……..

    Tom C | 25 September 2007
  • “Last morning this post saved my life”.

    Thank u very much. I think Java dates management is too obscure and complex.

    makay | 30 September 2007
  • how to convert date in yymmmdd format to mm/dd/yy format in java like Convert ‘97Jan02′ to 01/02/97

    Bandana | 9 October 2007
  • Sir,
    i have one doubt, i am using struts 2.1 datepicker tag. how this date get converted into sql3 date format.Please reply the solution.
    in advance thanx.

    vedavati | 22 November 2007
  • i am chinese boy,and i an english poor,but i want to say thank you!

    xiaobai | 23 February 2008
  • Seeing something weird; when input date to java.sql.Date, am getting return in which month is always 1; as in:

    Date dateOfBirth = null;
    SimpleDateFormat dateFmt = new SimpleDateFormat(”mm/dd/yyyy”);
    Timestamp disableDate = new Timestamp(dateFmt.parse(((String) e.getValue()).trim()).getTime());
    dateOfBirth = new java.sql.Date(disableDate.getTime())

    where dateOfBirth is 07/06/1956, I consistently get 1956-01-06

    Any particular reason for this?

    thnx

    randomiser | 10 April 2008
  • Randomiser, The “m” in your format string means minute, not month. Try using “M”.

    Bennett | 10 April 2008
  • Great! I swore for a while trying to get this done.

    Thanks!

    JM | 26 April 2008
  • Hi,
    I’ve read most of your script and it has been
    helpful to me, I need a help. I an new in coding and I have been given an assignment to develop a loan application software with Netbeans 6.0 using java codes please I need your help.

    Oscar Agyei | 4 May 2008
  • Hi,
    I want to store a datetime in entity(of JPA)(via controller processing).In entity date is simply
    in Date(date in Oracle). But i want to store date with time. Date becomes from JSF form via entity bean(in request scope).What should I do??

    saikat78 | 11 May 2008

Other comment pages: « 1 [2]

Post your comment | RSS feed for comments
Close
E-mail It