Need to compare two different time formats

Describe the problem/error/question

Hello everyone,
I would like to compare datasets with two different time formats. Not a problem at all, but in my case it is. From one system I’m getting ISO Date/Time. From another system I’m getting the ISO Date and Time in two different fields.

For example.
System 1 gives me:
dateModified: 2024-02-16T14:00:04+00:00
System 2 gives me:
Last Date Modified: 2024-02-16T00:00:00.000Z
Last Time Modified: 1754-01-01T12:52:28.063Z

I dont know why System 2 uses such a stupid database design (at least in my oppinion) but thats not what it is about here. I need to combine the 2 fields from System 2 to one date/time field, so I can compare it with the date/time from System 1.

Any ideas?

Please share your workflow

Share the output returned by the last node

ERROR: Invalid date format
Should get: 2024-02-16T12:52:28.063Z

Information on your n8n setup

  • n8n version: 1.27.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker

hello @lordimac

you can get the proper datetime from the system 2 with Edit Fields node and this payload:

1 Like

Thank you very much!

@lordimac

The time node is much easier to format with

Hello, no it does not work with the two inputs. I guess the time value needs to be converted.

Result:
The value “1754-01-01T12:52:28.063Z” is not supported!

Convert the data to a common format eg as in my example. From this you can then use the format from your desired format easily

That one doesn’t solve the original issue.

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