Hi,
how to retrieve date string from a date custom field?
I was trying something like:
date('Y-m-d', strtotime($_POST[ 'wpcf' ][ 'event-date-and-time' ]))
to set up post title, but I end up with date 1970-01-01
My WordPress is set to y-m-d date pattern.
Regards
To my knowledge, dates are already saved as Unix Timestamp so there is no need for
Do you mean from a Toolset Types Date Field?
Those Fields store a timestamp in the Database, which looks like a long number.
You can either display it with our ShortCodes (both raw and in human readable format) or by PHP.
In PHP you can retrieve it with a simple get_post_meta() and then covert this to anything you like with the date() function.
hidden link
https://developer.wordpress.org/reference/functions/get_post_meta/