Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a field having time in Seconds, i want to convert it to h:mm:ss,
Please suggest the best approach
Regards
hi,
this might help you.
=time(Seconds/3600,'hh:mm')
hi Deepak,
take an example 7270 seconds, by ur formula ..
=time(7270/3600,'hh:mm:ss').
Its giving incorrect result.
take it as the exmple ,, it should give 2 hours 1 min and 10 seconds.
Try this one:
=time(Time#(7270,'s'))
Hi Surender,
You have to use time() function along with hh:mm:ss format in your script.
like
suppose your fieldname is timeinseconds then
time(timeinseconds,'hh:mm:ss') as timeinhour
Regards,
Yogesh
Thanks a lot Johnnes
Hi Sir,
what deepak said is right with a little mistake. it would be
Time(7270/(3600*24),'hh:mm:ss')
Regards, tresesco
thnx .. dear Tresesco..
I had to do a similar thing. I had time in seconds and needed to convert to HH:MM:SS. Tresesco's function works and should be marked as a solution to this problem. This question is currently marked as "not answered".
On the load script, I had a field called "timeinseconds". I created a new field called "hmstime". I can then do time math on this field.
num(div(timeinseconds,3600),00) & ':' & num((div(timeinseconds,60)-(div(timeinseconds,3600)*60)),00) & ':' & num(mod(timeinseconds,60),00) as hmstime
On my form I put a list box with an expression as the only field to calculate the length of the selected items.
='Duration: ' & time(sum(hmstime),'hh:mm:ss')
Tresesco's function Time(timeinseconds/3600*24),'hh:mm:ss') worked great and was simpler than my math.
Thanks..worked great.