ADDITIONAL SYSTEM INFORMATION :
windows 7 64 bit
A DESCRIPTION OF THE PROBLEM :
while converting String "1900-01-01 05:45:00.000" to date it gives date "1900-01-01 06:08:20.000"
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
while converting String "1900-01-01 05:45:00.000" to date it gives date "1900-01-01 06:08:20.000"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"1900-01-01 05:45:00.000"
ACTUAL -
"1900-01-01 06:08:20.000"
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args){
try {
String defaultDate = "1900-01-01 05:51:00.000";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
Date date = sdf.parse(defaultDate);
DateUtils.parseDate(defaultDate, new String[]{"yyyy-MM-dd hh:mm:ss.SSS"});
System.out.println(date);
}catch(Exception e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
windows 7 64 bit
A DESCRIPTION OF THE PROBLEM :
while converting String "1900-01-01 05:45:00.000" to date it gives date "1900-01-01 06:08:20.000"
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
while converting String "1900-01-01 05:45:00.000" to date it gives date "1900-01-01 06:08:20.000"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"1900-01-01 05:45:00.000"
ACTUAL -
"1900-01-01 06:08:20.000"
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args){
try {
String defaultDate = "1900-01-01 05:51:00.000";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
Date date = sdf.parse(defaultDate);
DateUtils.parseDate(defaultDate, new String[]{"yyyy-MM-dd hh:mm:ss.SSS"});
System.out.println(date);
}catch(Exception e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8266262 SimpleDateFormat incorrectly formats 1900-01-01 08:00:00
- Closed