$php_mysql$ Posted August 13, 2011 Share Posted August 13, 2011 friends i store post time using timestamp and the format is something like this] 2011-08-14 00:55:51 below is the got where in $match_time i want time format show similar to how my db stores in time row, i tried echoing the $match_time which shows output like 184324234 but not like 2011-08-14 00:55:51, what im trying to achieve is in time count i store days which will count in db and see if any row is greater than the time count and disply it, $time_count = 7*24*60*60; $match_time = time() - $time_count; $sql="SELECT id FROM tbl WHERE time < '".match_time."'"; Quote Link to comment https://forums.phpfreaks.com/topic/244711-get-time-format-exact-like-db/ Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 $match_time = date('Y-m-d H:i:s',time() - $time_count); //should work, but Un-tested Quote Link to comment https://forums.phpfreaks.com/topic/244711-get-time-format-exact-like-db/#findComment-1256914 Share on other sites More sharing options...
$php_mysql$ Posted August 13, 2011 Author Share Posted August 13, 2011 thanks soo much bro works perfect :-) Quote Link to comment https://forums.phpfreaks.com/topic/244711-get-time-format-exact-like-db/#findComment-1256917 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.