Hi,
I want to convert the seconds into 60 seconds into 1 minute i.e, 00:01:00
600 seconds into 10 minute i.e., 00:10:00
Thank you in advance
Solved! Go to Solution.
Hi @Anaz_S try this syntax in a formula with your field.
PadLeft(ToString(Floor([Seconds]/3600)),2,"0") +
Right(DateTimeAdd("1900-01-01",[seconds],"seconds"),6)
Hello @Anaz_S,
is this ok?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
Hi @Anaz_S,
You could use a datetimeadd() function to add the number of seconds and store the value as a time data type.
DateTimeAdd('1900-01-01',[Value],'seconds')
If this solves your issue please mark the answer as correct, if not let me know!
Regards,
Jonathan
Hey Jonathan and others, I'm curious if anyone knows why this formula works? Thanks!
DateTimeAdd('1900-01-01',[Value],'seconds')
there isnt really much to explain. the DateTimeAdd function will take a date, and add a value to it. all you need to do is specify the interval that you're adding
DateTimeAdd('1900-01-01', 3600, 'seconds') will add an hour to the base date
DateTimeAdd('1900-01-01', 60, 'minutes') will add an hour to the base date
DateTimeAdd('1900-01-01', 1, 'hours') will add an hour to the base date
DateTimeAdd('1900-01-01', 1, 'days') will add a day to the base date...
you can also subtract
DateTimeAdd('1900-01-01', -1, 'days') will subtract a day from the base date
This means that if you see a timestamp of "1900-01-01 05:00:00", then @Anaz_S will know that they have 5 hours' worth of seconds
In fact, if they're certain that they'll never have more that 24 hours, then they could just save it at a Time field instead of a DateTime field
Thanks! I was a little confused by the 1900-01-01 date, but I see now that piece is irrelevant.
@afv2688 awesome! your solution worked for me. thank you!