soderlind / acf-field-date-time-picker

Date and Time Picker field for Advanced Custom Fields v3 and v4
GNU General Public License v2.0
65 stars 27 forks source link

Use date_create_from_format rather then strtotime #48

Closed pravdomil closed 10 years ago

pravdomil commented 10 years ago

Fixes that values is not saved if you are using different datetime formats. https://github.com/soderlind/acf-field-date-time-picker/issues/47

soderlind commented 10 years ago

I would have used date_create_from_format (PHP 5 >= 5.3.0) if WordPress required PHP 5 >= 5.3.0, but WordPress requirement is PHP 5.2.4.

pravdomil commented 10 years ago

so if phpversion() is capable of date_create_from_format do it otherwise please note that the custom datetime formats is not working properly for my it takes 4 hours to figure out what is happening thanks!

soderlind commented 10 years ago

Sorry for your trouble.

I'll add av phpversion check in the next release.

pravdomil commented 10 years ago

and another simple sollution is just do not save it as timestamp :)