I've created the function below:
public static String marshalDate(Calendar value) {
if (value == null) {
return null;
} else {
DateFormat date = new SimpleDateFormat("yyyy-MM-dd");
String format = date.format(value.getTime());
return format;
}
}
The input will be Calendar, the string value is: 2014-10-17 00:00:00.000000
The expected result after running the function above should be:
2014-10-17
it works properly when I deploy the spring boot application locally and hitting the API on local.
But when deploying the spring boot application on AWS, and I was hitting the API from local, the value that I received is:
2014-10-17-04:00
I guess the server was returning the timezone as the suffix.
How can I remove the -04:00
with function above?
Thank you very much