Forum Moderators: coopster
UPDATE time SET watch = NOW()
I get a result like :
1176673403
What I was wondering is what is the above method of formating time called?
I've been trying to research the method used to get time results such as the format above because I would like to know the method of converting it back to a standard more conventional format like:
14:32:00
I know how to format time as I put it in the database but if there a function to convert the format from one display method to another?
I think this is right:
$today = date('H:i:s',strtotime("now"));
edit: sorry I had the wrong time format for you.
Thanks for your input. Is there a function to calculate total time between two time stamps? Lets say I had a button page A and I wanted to calculate how long it took a visitor to get from page A to page B but I only want the result in 00:00:00 format. Overall what I'm trying to do is vonvert the Unix timestamp to a standard GMT format so that I can get the difference between two time events.
To check the difference between two timestamps, just find the difference (
$diff = abs($time1-$time2);) then break it apart into constituent time blocks. This past thread [webmasterworld.com] gives an idea of the process and the PHP manual page for the time function [php.net] has some good examples in the comments.