Problem:
Create a custom date field, No matter what date I choose from the datepicker (custom date field in a custom post type), when I save the content it always says "Please enter a date after 1 January 1970".
Solution:
the problem is in the Types file \types\library\toolset\types\embedded\functions.php, line 737~745:
/** * Checks if timestamp supports negative values. * * @return type */ function fields_date_timestamp_neg_supported() { return strtotime( 'Fri, 13 Dec 1950 20:45:54 UTC' ) === -601010046; }
In your webserver, the strtotime( 'Fri, 13 Dec 1950 20:45:54 UTC' ) return value:
-600992046
but it should be value: -601010046
There are 5 hours (18000) between above two values (-601010046 and -600992046), which produce the problem: Types can not save the timestamp into database.
It is different value from -601010046, that means your webserver can not return the correct timestamp value, you will contact your webserver provider to correct it.
Relevant Documentation:
http://php.net/manual/en/function.strtotime.php
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Hong_Kong (GMT+08:00)
This topic contains 16 réponses, has 2 voix.
Last updated by Sanny Il y a 7 années et 9 mois.
Assisted by: Luo Yang.