How convert string to time format

Hi, everyone,
I’d like to put a number in time format. For example: 1220 => 12:20 or 12h20
745 => 7:45 ou 7h45
Do you have any idea how to do this? I can’t find anything about this problem. Thanks

@etoughet You could use the String Manipulation and the String to DateTime Nodes to achieve this.

1 - Read the string
2 - Reverse it to get the last two digits and place “h” or “:” and then reverse it back.
3 - Use the String to DateTime to convert that to time…

Hi @etoughet

An alternative… use math formula to calc seconds since midnight with the formula

floor($column1$/100)*3600 + ($column1$- floor($column1$/100)* 100)*60

:wink:

Then use Unix Timestamp to Date&Time

image

takbb thank you for your help, I’ve tried your method but unfortunately I can’t find the desired result.
Flow3


Hi @etoughet,

I think I forgot to highlight the “Convert to Int” box in the Math Formula, as the Unix timestamp node requires a column with an Integer datatype

Hopefully then 41400 will become 11:30, and 58,800 will become 16:20 (I hope that’s the times you are expecting! :slight_smile: )

1 Like

Hi can you give more informations how to configure the node? Thx

It’s working, thank you so much Takbb

2 Likes

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