I am trying to parse the date from the string and then save to DB, but sometimes when checking on DB the year value is wrong.
private SimpleDateFormat simpleDateFormatTimestampJPOS = new SimpleDateFormat("yyyyMMddHHmmssSSS");
private Date findTxnDate() throws ParseException
{
Date date;
String timeStamp = "20181115040613555";
date = simpleDateFormatTimestampJPOS.parse(timeStamp);
return date;
}
I don't know what happens, this is a problem from SimpleDateFormat, the server, or etc. can somebody help me?
1018 and what i expected is 2018
fyi java version on server
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)