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

Adding 24 minutes to timestamp represented as Date

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_74"
      Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux 2.6.32-642.1.1.el6.x86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      When I convert string date "1990-01-01 01:00:00.000" into Date and then print it out I get different hour "1900-01-01 01:24:00.000". The behaviour is visible only on Linux (01:24), while on Windows I get hour 01:00.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the following test program:

      package test;
      import java.text.ParseException;
      import java.util.Date;

      public class Test
      {
        public static void main(String[] args) throws ParseException
        {
          Date d = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse("1900-01-01 01:00:00.000");
          System.out.println(d);
        }
      }


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Mon Jan 01 01:00:00 CET 1900
      ACTUAL -
      Mon Jan 01 01:24:00 CET 1900

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Date d = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse("1900-01-01 01:00:00.000");

      System.out.println(d);

      ---------- END SOURCE ----------

      Attachments

        Issue Links

          Activity

            People

              okutsu Masayoshi Okutsu
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: