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); Quote 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)); Quote 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. Quote 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! Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/132800-solved-change-date-format/#findComment-690635 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.