我最初的方法是:
$current = time(); // save this to column CURRENT_TIME with column type VARCHAR
//retrieve it like this
$retrieved = mysql_query(....) //assume query for getting the stored time value
$time = strtotime($retrieved);
我遇到了以下方法:
- 用于
gmstrftime处理 GMT - 使用
INT而不是VARCHAR列 - 使用 mysql 函数
CURTIME或CURDATE - 使用
UNIX_TIMESTAMPmysql函数
其中没有一个使用DATETIMEor TIMESTAMPmysql var 类型。
您对此有更好的方法吗?