对时间的格式化输出:
public function DT14($timestamp = null)
{
if(empty($timestamp)) $timestamp = time();
return strftime("%Y%m%d%H%M%S",$timestamp);
}
public function DT19($timestamp = null)
{
if(empty($timestamp)) $timestamp = time();
return strftime("%Y-%m-%d %H:%M:%S",$timestamp);
}
获得时间戳:
public function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}