Copy link to clipboard
Copied
I need to calculate the age based upon the time specified.
E.g.
Suppose time specified is:
3605000 millisecinds
It should return an age of : 1 Hour 5 seconds.
Was wondering if anyone can help me here.
Thanks,
SAM
Copy link to clipboard
Copied
I *think* this'll do you, but I'd suggest you check as I'm more concentrating on my mexican chicken sandwich at the moment:
<cfscript>
Time = 8605000 ;
TimeData = {} ;
TimeData.Hours = int(Time / 3600000) ;
TimeData.Minutes = int(Time / 60000) MOD 60 ;
TimeData.Seconds = int(Time / 1000) MOD 10 ;
</cfscript>
<cfdump var="#TimeData#">
Copy link to clipboard
Copied
What about using the following millisecondsToDate UDF http://www.cflib.org/udf/millisecondsToDate ?
#millisecondsToDate(3605000)# -> {ts '1970-01-01 01:00:05'}
#TimeFormat(millisecondsToDate(3605000),"hh:mm:ss")# -> 01:00:05
Cyril