PHP将ISO日期转换为更易读的格式? [英] PHP Convert ISO date to more readable format?
本文介绍了PHP将ISO日期转换为更易读的格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
只是一个简单的问题。如何将PHP ISO时间(如2010-06-23T20:47:48-04:00)转换为更可读的东西? PHP中已经建立了一个功能吗?我周围环顾四周,但我没有看到任何转换时间的东西。如果没有功能,可以吗?
谢谢
解决方案
pre> $ format =d MY; //或其他日期()接受的格式
date_format(date_create($ time),$ format);
Just a simple question. How do I convert a PHP ISO time (like 2010-06-23T20:47:48-04:00) to something more readable? Is there a function already built in PHP? I've looked around but I haven't seen anything to convert times. If there's not a function, is it possible?
Thank you
解决方案
$format = "d M Y"; //or something else that date() accepts as a format
date_format(date_create($time), $format);
这篇关于PHP将ISO日期转换为更易读的格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文