AnsweredAssumed Answered

Need to convert date from full date (locale=en_US.UTF-8) to ISO

Question asked by Marek Kaszycki on Sep 12, 2018
Latest reply on Sep 18, 2018 by Marek Kaszycki

Hi,

 

I have a problem converting a date to ISO format in the Date Conversion stage. There are two possible formats for the date:

Fri, 2 Feb 2018 07:57:34 +0100

Fri, 2 Feb 2018 07:57:34 +0100 (CET)

 

I have modified the standard Date Conversion stage, added my field name, and:

- regular expression:

^\w{3},\s\d{1,2}\s\w{3}\s\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}\s[\+\-]\d{4}

I think this is correct, except for probably the comma (should it be escaped? how? standard Perl/Tcl or Vim don't offer a way to escape it, except possibly \b for word boundaries).

- scan pattern:

EEE, dd MMM yyyy HH:mm:ss X

To the best of my knowledge, this is okay right up until the X, where I have no idea what to put. I'd appreciate input on this as well.

 

Thank you in advance!

Marek

Outcomes