ohdang888 Posted August 29, 2008 Share Posted August 29, 2008 i want to turn this: "08-08-08" into "August 8th, 2008" but i can't figure out how to do it... here's what i have so far and the error i'm getting: date("08-08-08", 'D, js'); Warning: date() expects parameter 2 to be long, string given in /home/public_html/index.php on line 180 Thanks! Link to comment https://forums.phpfreaks.com/topic/121893-date-question/ Share on other sites More sharing options...
DeanWhitehouse Posted August 29, 2008 Share Posted August 29, 2008 ("08-08-08, D, js"); edit: i just fixed your code, so it might be the wrong format still. Link to comment https://forums.phpfreaks.com/topic/121893-date-question/#findComment-628946 Share on other sites More sharing options...
DarkerAngel Posted August 29, 2008 Share Posted August 29, 2008 Here is a little function I wrote for you. string format_date(string $date_str) <?php function format_date($date_str) { $date_arr = explode("-", $date_str); return date("F S, Y", mktime(0, 0, 0, $date_arr[0], $date_arr[1], $date_arr[2]); } ?> Link to comment https://forums.phpfreaks.com/topic/121893-date-question/#findComment-628952 Share on other sites More sharing options...
obsidian Posted August 29, 2008 Share Posted August 29, 2008 <?php echo date('D, js', strtotime('08-08-08')); ?> Link to comment https://forums.phpfreaks.com/topic/121893-date-question/#findComment-628957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.