Currently it’s in string format and I would like it to have in actual date time format for easy comparison with other data sets: yyyy-mm-dd hh:mm:ss (no am/pm).
Hi @robvp The case of AM and PM is locale dependant. What locale are you using? I think en-GB converts upper case but en-US is lower case. It might be the other way round. Try both.
Can you share a screenshot of the configuration window? I’m not getting it to work Perhaps - as mentioned below - it depends on the locale. I tried en-US en en-GB but didn’t work.
I’m always getting the following error:
Could not parse date in cell [Row0, column “Activity Date”, row 1]: Text ‘Jul 22, 2015, 6:25:49 PM’ could not be parsed at index 0.
Hi @ArjenEX and @robvp , as per @rfeigel’s note, I found that with dd it fails on a single digit day, e.g. “Jul 8, 2015, 7:04:16 PM” so agree that the mask needs to be MMM d, yyyy, h:mm:ss a to handle all the rows in the initial post.
Also, yes I concur that it works for en-US and fails for en-GB. This is attributable to the uppercase AM/PM. If it is lower case “am/pm”, en-US would fail, and en-GB would work.
@robvp the only way I could get KNIME to produce the error message
Could not parse date in cell [Row0, column “Activity Date”, row 1]: Text ‘Jul 22, 2015, 6:25:49 PM’ could not be parsed at index 0.
from the date Jul 22, 2015, 6:25:49 PM
was to introduce an additional space at the start of the the format mask, so it was
instead of
If you still can’t get it working there is something else we’re missing about your data, or environments. Can you upload a small workflow with just your sample data and the String to date&time node ?
Hmm…when I copied your date format to mine my configuration also worked. Very strange. I don’t know what the problem is, but it’s solved now. Perhaps I used - by accident - a hidden character somehow causing it not to work.
Hi @robvp , as I mentioned earlier the only way I could make it produce that error was if there was a space at the beginning of the format mask… Anyway glad you found it. Have a great Christmas.