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

Error in Timestamp.valueOf with time zone "America / Buenos_Aires"

XMLWordPrintable

    • generic
    • generic

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      Timestamp.valueOf change the date created, time actually changes the date. This is not true for all dates, just for some in particular. This happens Timezone "America / Buenos_Aires".

      Example:
      Timestamp result = Timestamp.valueOf("1991-10-20 00:00:00");
      this change date to "1991-10-20 01:00:00" (change hours)

      This error does not occur with such TimeZone "America / Los_Angeles".
      Sorry for my English.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.sql.Timestamp;
      import java.util.*;
      public class HelloWorld{

           public static void main(String []args){
              TimeZone.setDefault(TimeZone.getTimeZone("America/Buenos_Aires"));
              String date = "1991-10-20 00:00:00";
              System.out.println("date: " + date);
              Timestamp date_timestamp = Timestamp.valueOf(date);
              System.out.println("date_timestamp: " + date_timestamp);
           }
      }
      ---------- END SOURCE ----------

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: