Thehive - Date & Time Node from Unix(ms) to YYYY-MM-DD

Describe the issue/error/question

Trying to use the Date & Time Node to convert from Unix(ms) to YYYY-MM-DD.
Input value is 1664182250993 (which according to Cyberchef is Unix(ms) which seems correct)

Output value in Cyberchef is “Mon 26 September 2022 08:50:50.993 UTC” which correct with the application (ThHive)

When I try to use Date & Node on the correct field with “From Format” set to “x” I get the result:
54705-11-02 (To Format: YYYY-MM-DD)

Anyone see anything wrong with the above or can replicate the bug?


image
image

Information on your n8n setup

  • n8n version:
    Version 0.204.0

  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:
    Docker

Hi @DkYSwe, I am so sorry to hear you’re having trouble.

It seems the Date & Time node can’t handle dates formatted as number rather than a string. Can you try appending .toString() to your expression? This did the job for me:

Workflow:

2 Likes

Thanks @MutedJam - that solved it! Many thanks! :smiley: :star2:

1 Like

Sweet, glad to hear! Thanks so much for confirming and sorry for the trouble.

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