gladiator83x Posted June 16, 2006 Share Posted June 16, 2006 Hey All,I had inserted timestamps in several of my MYSQL tables. One time stamp represents the time that something was created, the other represents the time that that same something was finished and submitted. I was trying to figure out if there was some sort of math function that will take the difference of these two timestamps? The piece of code below shows how I am obtaining my timestamps; I then just echo the variable I equate the date function to.$test_date = date("Y-m-d H:i:s"); If any of you could help me out on this one, that would be awesome [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Link to comment https://forums.phpfreaks.com/topic/12198-timestamp-issue/ Share on other sites More sharing options...
tecdesign Posted June 16, 2006 Share Posted June 16, 2006 try this [code]$result=mysql_query ("SELECT UNIX_TIMESTAMP(mysql_column) as epoch_time FROM table"); $unix_timestamp = mysql_result ($result, 0, 0); echo date("F j, Y @ g:ia", $unix_timestamp);[/code]Search in the new snippet section also, they have a really good tutorial on this area. Big ups for the admin for creating the new section. Link to comment https://forums.phpfreaks.com/topic/12198-timestamp-issue/#findComment-46465 Share on other sites More sharing options...
gladiator83x Posted June 16, 2006 Author Share Posted June 16, 2006 Hey Tec_Matt,I'll give it a shot. Thanks. Link to comment https://forums.phpfreaks.com/topic/12198-timestamp-issue/#findComment-46466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.