-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
17
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Java 1.7/1.8 Windows
A DESCRIPTION OF THE PROBLEM :
Please see the code below:
import java.text.SimpleDateFormat;
import java.text.DateFormat;
class Date1{
public static void main(String[]args){
DateFormat format = new SimpleDateFormat("dd-MMM-YYYY");
System.out.println("Date is "+ format.format(new java.util.Date("12/31/2020")));
}
}
The result is showing as Date is 31-DEC-2021 but actually the date should be 31-DEC-2020 because that is the requirement.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute above code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Date is 31-DEC-2020
ACTUAL -
Date is 31-DEC-2021
Java 1.7/1.8 Windows
A DESCRIPTION OF THE PROBLEM :
Please see the code below:
import java.text.SimpleDateFormat;
import java.text.DateFormat;
class Date1{
public static void main(String[]args){
DateFormat format = new SimpleDateFormat("dd-MMM-YYYY");
System.out.println("Date is "+ format.format(new java.util.Date("12/31/2020")));
}
}
The result is showing as Date is 31-DEC-2021 but actually the date should be 31-DEC-2020 because that is the requirement.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute above code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Date is 31-DEC-2020
ACTUAL -
Date is 31-DEC-2021
- duplicates
-
JDK-8235968 Bad date(year) formating: Output is 30-12-2020 instead of 30-12-2019
-
- Closed
-