need to change second value to minutes
Posted on 2000-04-07
I previously posted a question on comparing 2 dates together to get a value that represents the differance.
I think I am getting closer to solving the problem but I still need help with one final part.
I need to track the time in minutes/seconds that a user has been on a page
I have 2 times one time is subtracted from the other and I am able to get a value of seconds or minutes. The problem with minutes is that it is not acurate enough. I need the answer to show seconds also. I can get the total second but then I cannot convert the seconds to show the time as minutes and seconds (output should look like this- 1:35)
Here is my code so far
<CFSET Variables.date1 = "07 Apr 12:39:56">
<CFSET Variables.date2 = "07 Apr 12:35:59">
<CFSET Variables.differenceSec = "#Abs(DateDiff("s", Variables.date1, Variables.date2))#">
The duration is <CFOUTPUT>#Variables.differenceSec#</CFOUTPUT>
When I divide the Variables.differenceSec by 60 I get the wrong answer it looks like this 3.6788784
How do I convert a number like 237 seconds to display the equivelent time in minutes and seconds?