I cannot find it in the documentation, what is the default form of hour in the DateList
when the form {y,m,d,h,m,s}
is used. I would assume 24 hour system since there is no am/pm
specification, but it is american software so I am not sure...
-
$\begingroup$ why don't you just try it and see? $\endgroup$– lericrApr 4, 2022 at 17:27
1 Answer
It's the 24h format. This can be easily checked by running:
dates = {"04/04/2022 6:20:23 PM", "04/04/2022 6:20:23",
"04/04/2022 6:20:23 AM", "04/04/2022 18:20:23"};
DateList /@ dates
(* {{2022,4,4,18,20,23.}, {2022,4,4,6,20,23.}, {2022,4,4,6,20,23.}, {2022,4,4,18,20,23.}} *)
Note that the hour format accepts hours >24, which then gets added to the day in the output.
DateList[{2022, 4, 4, 26, 20, 23}]
(* {2022,4,5,2,20,23.} *)
DateList[{2022, 4, 4, 45, 20, 23}]
(* {2022,4,5,21,20,23.} *)