日期函数

1)

定义和用法

strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。
语法
[pre]strtotime(time,now)[/pre]
参数 描述
time 规定要解析的时间字符串。
now 用来计算返回值的时间戳。如果省略该参数,则使用当前时间。

2)
定义和用法
time() 函数返回当前时间的 Unix 时间戳。
语法
[pre]time(void)[/pre]
参数 描述
void 可选。

把2010-01-01 2 12 35


4)$time=date("Y-m-d H:i:s",time());

3)$fromTime = str_replace("-",'' ,substr($fromTime,0,10));

原文地址:https://www.cnblogs.com/y0umer/p/2809653.html