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
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 CreateFile无法获取特殊文件内容
- ¥35 基于python的有ssl加密传输的socket聊天室
- ¥15 数码管亮度控制器设计
- ¥15 kafka客户端跨网段访问,看日志提示连接的还剩内网地址,且访问不通
- ¥15 关于c语言代码的问题
- ¥15 c51单片机控制步进电机
- ¥20 Visual studio无法检测到设备
- ¥30 vue 页面窗口放大或者缩小元素会变化
- ¥15 questasim仿真报错
- ¥15 寻找电脑攻防的导师,有问题请教一下。