Viewing 4 replies - 1 through 4 (of 4 total)
  • Same problem here.. I am in MST timezone and I get date and time both wrong. Looks like the plugin doesn’t follow WordPress general settings Timezone which can easily be used with wp_timezone() and wp_timezone_string(). Hope the author will correct this. Thank you for the great plugin.

    +1 here! This isn’t an issue before, now I have to change the times in the exported file by hand; please fix this ASAP!

    Best regards,

    Andre

    I have the same problem. I checked the server time (WHM), the wordpress time and are ok. But in Advanced Contact Form 7 DB the submit_time appears 5 hours ahead.

    I can confirm that it is still happening. The time is UTC, not the local time (date.timezone =”country/place” PHP config).
    Slightly difficult solution:
    My preference would be for the submit_time to stay as UTC but for the data presentation (exports, admin forms) to show the DateTime in the defined timezone. Additionally the logic would be applied to all the SQL used.
    Trivial solution:
    Save the data in the local timezone.
    DIY solution:
    Use the vsz_cf7_posted_data filter:

    function example_cf7_modify_form_before_insert_data( $posted_data ) {
    	$timestamp = WPCF7_Submission::get_instance()->get_meta( 'timestamp' );
    	if ( $timestamp ) {
    		$date = ( new DateTime( '', new DateTimezone( wp_timezone_string() ) ) )->setTimestamp( $timestamp );
    		$posted_data['submit_time'] = $date->format( 'Y-m-d H:i:s' );
    	}
    
    	return $posted_data;
    }
    • This reply was modified 3 years, 10 months ago by adriangreen. Reason: remove hard-coded timezone string
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wrong submit time’ is closed to new replies.