I need to transform decimal value to an hour

Hello community

Describe the issue/error/question

I’m stuck trying to transform decimal value from à sheet cell to a standard hh:mm:ss

What is the error message (if any)?

Problem executing workflow

There was a problem executing the workflow:
“Date & Time: The date input format could not be recognized. Please set the “From Format” field”

The decimal value is in french so “coma” is used not “dot”

0,4166666667

Please share the workflow

Share the output returned by the last node

The result need to be 10:00:00

Information on your n8n setup

  • n8n version: 0.182.0
  • Database you’re using (default: SQLite): gsheet
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Desktop

Hey @terryble66XX,
welcome to the community :tada:

The decimal value 0,4166666667 seems to be days, so 0,4166666667*24= ~10. In order to convert this to a date time I used the following expression

image

This creates a date time for today at 00:00 and adds 0,4166666667 days. You can than use the Date & Time node to transform your date format like this.

Here is an example workflow to illustrate.

Hello @marcus well done it works!
Thank you for this quick and great help.

1 Like