I send the current date to database using this code: gmdate("Y-m-d H:i:s") PHP: But the time is being sent incorrectly. The time is set incorrectly on my server! I want to send the time, what is in my country now, not what is set on users' computer or on the server. Is it possible? The database is mysql. Thanks in advance.
PHP is not client side language ! PHP sends YOUR server date/time, so .. if you can't check your clock, forget about it !
Than why does it send different time when I change the time on my computer? What if my server is in different time zone than me?
Where should I add this function if my code looks like this: if ($_POST['lev-post-content']) { $insert = "INSERT INTO " . $table_name . " (date, user_id, post_id, content) " . "VALUES (now(),'" . $wpdb->escape($_POST['lev-post-author-id']) . "','" . $wpdb->escape($_POST['lev-post-id']) . "','" . $wpdb->escape($_POST['lev-post-content']) . "')"; $results = $wpdb->query( $insert ); PHP: