Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert ISO 8601 date+time string to date

Tags:

I would like to convert a date string from ISO 8601 format (as generated correctly by the "Format Date" block) back to a usable date. I have tried using "Get Dates from Input" but this unfortunately appears not to read the time part correctly.

The flow up to "Format date" yields the string 2018-09-24T11:33:23+02:00, but the "Get Dates from Input" shows 12:00 as the time regardless of when this shortcut is run.

Workflow showing problem

PS: This is a simplified example. The actual date string will be coming from a web service, so I have no control over the incoming format - I need to parse this kind of date to continue with the other things I'm trying to do.

like image 608
chthonicdaemon Avatar asked Sep 24 '18 09:09

chthonicdaemon


1 Answers

Turns out that the parser works just fine if you replace the T in the ISO format with a space. It even appears to handle the time zone conversion correctly.

Solution with replace text

like image 178
chthonicdaemon Avatar answered Oct 23 '22 09:10

chthonicdaemon