PHP date conversion to strtotime

后端 未结 2 2060
孤城傲影
孤城傲影 2020-12-02 03:07

I have an array where each record has a \'date\' field. The dates are in this format: \'10/09/2015\'. When I use strtotime

2条回答
  •  醉话见心
    2020-12-02 03:50

    Be aware of dates in the m/d/y or d-m-y formats; if the separator is a slash (/), then the American m/d/y is assumed. If the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. To avoid potential errors, you should YYYY-MM-DD dates or date_create_from_format() when possible.

提交回复
热议问题