refiking Posted November 15, 2008 Share Posted November 15, 2008 I want to change a timestamp in mysql into m/d/y H:i:s A and I've tried date and strtotime and neither has worked. Here's what I have: $date = $row['date']; $fdate = strtotime("m / d / y H:i:s A", $date); Link to comment https://forums.phpfreaks.com/topic/132800-solved-change-date-format/ Share on other sites More sharing options...
n3ightjay Posted November 15, 2008 Share Posted November 15, 2008 $fdate = strtotime("m / d / y H:i:s A", $date); try $fdate = date("m / d / y H:i:s A",mktime($date)); Link to comment https://forums.phpfreaks.com/topic/132800-solved-change-date-format/#findComment-690632 Share on other sites More sharing options...
Maq Posted November 15, 2008 Share Posted November 15, 2008 $date = strtotime($row['date']); $date_format = date("m/d/y H:i:s A", $date); Not tested. Link to comment https://forums.phpfreaks.com/topic/132800-solved-change-date-format/#findComment-690633 Share on other sites More sharing options...
refiking Posted November 15, 2008 Author Share Posted November 15, 2008 Presto! Link to comment https://forums.phpfreaks.com/topic/132800-solved-change-date-format/#findComment-690634 Share on other sites More sharing options...
Maq Posted November 15, 2008 Share Posted November 15, 2008 Curious, which one? Link to comment https://forums.phpfreaks.com/topic/132800-solved-change-date-format/#findComment-690635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.