I two date functions that I'm useing to convert Date/Times into another format.
Input_1: 02/01/21 11:00:00 AM
Input_2: 02/01/21 3:00:00 PM
Desired Output 1: 2021-02-01T11:00:00.000
Desired Output 2: 2021-02-01T15:00:00.000
fun date_time_format(d: LocalDateTime {format: "M/d/yy h:mm:ss a"}) = d as String {format: "yyyy-MM-dd'T'HH:mm:ss.SSS"}
fun date_time_format2(d: LocalDateTime {format: "M/d/yyyy h:mm:ss a"}) = d as String {format: "yyyy-MM-dd'T'HH:mm:ss.SSS"}
concert_time:
try(() -> date_time_format(Input_1) )
orElseTry(() -> date_time_format2(Input_1) )
orElse null
My resoult is null
when using Input_1 but when using Input_2 it's 2021-02-01T15:00:00.000