【发布时间】:2011-01-20 09:42:07
【问题描述】:
我最初的做法是:
$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函数
其中没有一个使用DATETIME 或TIMESTAMP mysql var 类型。
你有更好的方法吗?
【问题讨论】:
-
Grrr... 投了反对票,没有发表评论。