refiking Posted September 27, 2008 Share Posted September 27, 2008 I'm getting 12-31-1969 for the value. Here's my code: while ($raw = mysql_fetch_assoc($dql)){ $exp = $raw['exp_date']; } $exp = date("m-d-Y", $exp); When I take out the $exp = date line, I get the entire timestamp from the db. Link to comment https://forums.phpfreaks.com/topic/126089-solved-help-with-date-function/ Share on other sites More sharing options...
refiking Posted September 27, 2008 Author Share Posted September 27, 2008 I converted the timestamp to time then it worked. Here's what I put: while ($raw = mysql_fetch_assoc($dql)){ $date = $raw['exp_date']; } $time = time($date); $exp = date("m-d-Y", $time); Link to comment https://forums.phpfreaks.com/topic/126089-solved-help-with-date-function/#findComment-652002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.