I'm making use of Formidable Forms to acquire user data. The entered date should be converted to UNIX time to populate the Toolset date field. I found this guide on their site: hidden link
Please tell me, where do I find the Toolset date field ID?
The code of the Formidable post:
add_filter('frm_validate_field_entry', 'set_my_expiration_date', 10, 3);
function set_my_expiration_date($errors, $posted_field, $posted_value){
if ( $posted_field->id == 25 ) { //change 25 to the ID of the date field to change
// Get the first date in a UNIX timestamp
$first_date = date_create_from_format( 'd/m/Y', $_POST['item_meta'][20] ); //Change 20 to the ID of the first date field and change d/m/Y to the format on your Formidable -> Global settings page
$first_date = date_format( $first_date, 'Y-m-d' );
$first_date = strtotime( $first_date );
// Get the final date in Y-m-d format
$final_date = strtotime('+7 day', $first_date);
$final_date = date('Y-m-d', $final_date);
// Save the final date as the posted value
$_POST['item_meta'][$posted_field->id] = $final_date;
For your use case I suspect you may be better off using the frm_after_create_entry hook, which seems similar to our cred_save_data hook.
hidden link
So once the post is created, you can get the post meta (which will be in whatever format the form is submitting it in) then convert it to a timestamp, and then update the post meta with that value.