如何使用php解析日期字符串? [英] How can I use php to parse a date string?

查看:75
本文介绍了如何使用php解析日期字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

日期stringe是2010年4月30日



我想使用php解析字符串到2010-04-30,我该如何实现? >

谢谢!!

解决方案

尝试 http://php.net/manual/en/function.strtotime.php 转换为时间戳,然后 http://www.php.net/manual/en/function.date.php 以您自己的格式获取。


the date stringe is Apr 30, 2010

I want to parse the string into 2010-04-30 using php, how can I achieve this?

Thanks!!

解决方案

Try http://php.net/manual/en/function.strtotime.php to convert to a timestamp and then http://www.php.net/manual/en/function.date.php to get it in your own format.

这篇关于如何使用php解析日期字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆