Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4060343

date to string and string to data conversion

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.1
    • core-libs
    • None
    • sparc
    • solaris_2.5.1



      Name: sgC58550 Date: 06/20/97


      The code:
              java.util.Date dt1 = new Date();

              System.out.println(dt1+"\n");
              System.out.println(dt1.toString()+"\n");
              System.out.println((new java.util.Date(dt1.toString()))+"\n");
      The results:
      Fri Apr 18 10:02:39 EDT 1997

      Fri Apr 18 10:02:39 EDT 1997

      Fri Apr 18 09:02:39 EDT 1997
              
      There is one hour difference when you convert date into string and convert string back to date.

      I developed an encrpytion algorithm based on string encryption/decrpytion and work on encrpyt/decrpyt
      most java's data types. I found the above problem.
      company - TransQuest Inc , email - ###@###.###
      ======================================================================

            ssenthilsunw Shanmugam Senthil (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: