on 2021 Mar 26 11:52 PM
Hello,
I'm new with Hybris and i noticed that in my impexes with startTime[dateformat = yyyy-MM-dd hh:mm:ss] with the value 12:00:00 that is clearly 12:00 PM in the database are saved as 00:00:00 and this is wrong.

Can someone tell me how can i fix this problem? I can't see any errors and i dont know how to avoid this situation.
Thank You
Request clarification before answering.
It's not about ImpEx. It's about how date formatting works. As it documented in Oracle website (https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) lowercase-letter h is used for hour in am/pm (1/12) while uppercase-letter H is used for hour in day (0-23)
If you want to use 0-23 format, you need to change date-format value in the ImpEx header as [dateformat = yyyy-MM-dd HH:mm:ss]
The following code snippet shows the difference you are experiencing:
SimpleDateFormat SDF1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
SimpleDateFormat SDF2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateToParse = "2021-03-27 12:00:00";
System.out.println(SDF1.parse(dateToParse));
System.out.println(SDF2.parse(dateToParse));
The output
Sat Mar 27 00:00:00 EET 2021
Sat Mar 27 12:00:00 EET 2021
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.