How do I format a date in the format such as weekday, day month, year for example Friday, 18th October 2013? I have tried using strotime() and the echoing using date() function but can't achieve this format because weekday is not being returned properly.
2条回答 默认 最新
- douqiang4501 2013-10-18 15:53关注
This works correctly:
// Use string to time to get the date as a unix timestamp $myTime = strtotime("Friday, 18th October 2013"); // Use that timestamp to reform it into a date, in which ever format you want orrding to the date() documentation. $newTime = date('l, jS F Y', $myTime); // Show the date in the format echo $newTime;
See it working here: http://www.tehplayground.com/#i9U7grxCr
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报