Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
unix time
siraj_farooq
<p>how to find differences between two unix times....as it is hsowing date also.</p><p> </p>
Find more posts tagged with
Comments
kclark
<p>What difference are you trying to find in them? You might want to convert the timestamps so they are easier to work with doing something like this</p><pre class="_prettyXprint">var date = new Date(unix_timestamp*1000);var hours = date.getHours();var minutes = date.getMinutes();var seconds = date.getSeconds();var formattedTime = hours + ':' + minutes + ':' + seconds;</pre>
siraj_farooq
<p>thanks for replying kclark
</p><p>i have two differnt times when a work was started and when it was finished .......</p><p>first i used</p><p>FROM_UNIXTIME(task.timefinish),'%T:%s') to convert it in readable form( as it was first displayed in numbers)</p><p>after converting both of times i now want to take the difference in order to get the total time taken by a person to do a task...</p>
kclark
<p>I think you should be able to do something like this to get the difference between the two in seconds.</p><pre class="_prettyXprint _lang-">var diff = (secondTime.getTime() - firstTime.getTime())/1000;</pre>
siraj_farooq
<p>still cant get it right....i am adding my screen shot....preview them to see what is my problem....</p>