Help! String to Date&Time conversion error!

Hello fellow KNIMErs,

I’ve scoured the forum looking for similar issues but can’t seem to get around this one!

I’ve extracted a date from a PDF using a Regex Extractor and am now trying to convert that string into a Date format (dd MMM yyyy). However, I’m not met with this error message:

Could not parse date in cell [Row0, column “Full Match”, row 1]: Text ‘24 Sep 2024’ could not be parsed at index 3.

This led me to believe it was the spaces so I tried stripping my date to no luck. The data is sensitive so happy to post screenshots of what my results look like!

Any help would be greatly appreciated!

{C61BC434-E64B-454E-A1BD-B844E604DDB9}

Hi @BenJones13 , this is going to sound odd, but try using the locale en-US instead.

Your date format mask looks right, and I think your problem is that the “elders of Java” :wink: decided that we Brits write “Sep” as “Sept” and therefore if you use en-GB, it requires that for September, and September only(!), a three letter month abbreviation is four letters. The Americans have no such idiosyncrasies (well they do… but not related to this), and believe in three letters for all the month abbreviations!

btw, depending on whether days 1 to 9 are 01 to 09 or simply 1 to 9, you may also wish to change the mask to d MMM yyyy which can handle both 1 and 2 digit days, whereas dd requires a leading zero on single digit days.

3 Likes

Hi @takbb,

Fixed and working! Simple as that!

Extra embarrassment for being a Londoner but now the wiser, very much appreciated mate. Thanks a bunch.

Cheers

2 Likes

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