且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

解析日期到零件的功能

更新时间:2023-11-27 08:40:34

使用PHP> = 5.3, DateTime :: createFromFormat() 可以根据指定的格式解析日期。

With PHP >= 5.3, the DateTime::createFromFormat() allows one to parse a date according to a specified format.

之后,您将获得 DateTime 对象,最多可以使用它来获取您想要的数组。

After that, you get a DateTime object, and up to your to work with it in order to get the array you want.