My initial approach was:
$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);
I have come across the following approaches:
- use
gmstrftime
to handle gmt - use
INT
instead ofVARCHAR
for the column - use the mysql function
CURTIME
orCURDATE
- use the
UNIX_TIMESTAMP
mysql function
none of which were using the DATETIME
or TIMESTAMP
mysql var type.
Do you have a better approach for this one?