PHP strtotime incorrect conversion

前端 未结 2 1672
别那么骄傲
别那么骄傲 2020-12-20 00:57

I have looked in the manuals, It is probably a conversion weirdness but I cannot figure it out. I am getting a date from the user and attempting to validate it in PHP (versi

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-20 01:32

    By default PHP expects that and number-number-number is Y-m-d and works backwards from there until a date makes sense. You may have to change your locale setting: http://ca.php.net/manual/en/class.locale.php. This should fix the European date format error, but keep in mind that the reverse will now be a problem.

提交回复
热议问题