时间函数 

  1. time 函数
  2. maketime 函数
  3. strtotime 函数

 

time 函数

返回自从 Unix 新纪元(格林威治时间 1970 年 1 月 1 日 00:00:00)到当前时间的秒数。

int time()

maketime 函数

按给定参数产生时间量。

int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]])

strtotime 函数

由当前时间或给定时间产生新的时间戳

int strtotime ( string time [, int now])
<?php
echo strtotime ("now"), "\n";
echo strtotime ("10 September 2000"), "\n";
echo strtotime ("+1 day"), "\n";
echo strtotime ("+1 week"), "\n";
echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime ("next Thursday"), "\n";
echo strtotime ("last Monday"), "\n";
?>

相关主题:

PHP 日期函数