在php中将字符串转换为MySQL时间戳格式

Bra*_*esh 13 php mysql string android timestamp

我正在使用从android java应用程序发送的字符串在php中编写查询.
查询类似于:

$insertSQL = sprintf("INSERT INTO app_DuckTag (taste) VALUES (%s) WHERE species=%s AND timestamp=%s",
                         GetSQLValueString($_POST['taste'], "text"),
                         GetSQLValueString($_POST['species'], "text"),
                         GetSQLValueString($_POST['timestamp'], "text"));
Run Code Online (Sandbox Code Playgroud)

但是我怀疑时间戳是作为字符串存储在MySQL中的.
我应该如何在MySQL中将字符串转换为时间格式?
strtotime(string)php函数将其转换为unix时间.
但我想,MySQL存储的方式不同.谢谢.

编辑:这是它在MySQL phpmyadmin中显示的方式:2011-08-16 17:10:45

编辑:我的查询错了.Cannon使用带有Insert into的where子句.
查询必须是UPDATE .... SET ... = ... WHERE ....
但是接受的答案是在WHERE子句中使用时间的正确方法.

Pvd*_*vdL 31

这应该是全部:

date("Y-m-d H:i:s", strtotime($_POST['timestamp']));
Run Code Online (Sandbox Code Playgroud)

如果你想检查时区,你应该使用strftime而不是date