Parsing date time using string to date

Hi

I’m having trouble parsing a string such as ‘23/10/19 7:12:00 PM’ using string to date time.

I’ve used the format ‘dd/MM/yy hh:mm:ss A’ from the list but it says.

ERROR String to Date&Time 3:2 Execute failed: Failed to parse date in row 'Row0: Text ‘01/01/19 10:08:00 AM’ could not be parsed at index 18

Any help would be much appreciated

Thanks

datetime_problem.knwf (7.6 KB)

I’ve attached my knime workflow here. Thanks

I changed the format to:

dd/MM/yy hh:mm:ss a

and now it seems to work

We had a similar discussion before and I came up with a little bit of a messy solution. Maybe as an inspiration if further problems occur:

datetime_test.knwf (11.3 KB)

3 Likes

Hi there @srimalj,

welcome to KNIME Community!

From node description you can see that:
capital letter A is for milli of day
and small a is for am/pm of day

Also take your hours range into consideration:

h: clock hour of am/pm (1-12)
K: hour of am/pm (0-11)
k: clock hour of am/pm (1-24)
H: hour of day (0-23)

Br,
Ivan

4 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.