Entry time not wot work after update

hello i want to get form entry time and date and print it on customer receipt or send it to email

i use this script in function.php theme


add_filter( 'gform_replace_merge_tags', 'djb_gform_replace_merge_tags', 10, 7 );
function djb_gform_replace_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
if ( strpos( $text, '{current_hour}' ) !== false ) {
$text = str_replace( '{current_hour}', current_time( 'G' ), $text );
}
if ( strpos( $text, '{current_minute}' ) !== false ) {
$text = str_replace( '{current_minute}', current_time( 'i' ), $text );
}
return $text;
}

this code work well before i update gravityform to 2.5

now the Date work well but it show the time 00:00

seems something is wrong or must change in my code for work with new version

anyone have any idea whats the problem ?

thanks

I recommend using the built in logging in Gravity Forms and adding some custom logging statements to your code. First, enable logging:

Then add some custom logging statements to your code to see what’s no longer working. I recommend adding a logging statement inside each conditional and also after any variable is assigned a value:

1 Like