我想在用户执行某些操作时用当前时间更新我的表,我正在使用这个:
$date = date("Y-m-d", strtotime($date) );
$data_insert = mysqli_query($conn, "UPDATE account.account SET last_vote = '$date' WHERE login = '$account'") or die(mysql_error());
问题是所有内容都返回“1970-01-01”...
最佳答案
PHP strtotime() 函数。
The strtotime() function parses an English textual datetime into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT).
关于php - mysql 上的日期始终为 1970,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30416062/