php 时间戳

UNIX时间戳

date  格式化一个本地时间与日期

time()返回当前的UNIX时间戳

microtime 返回当前的UNIX时间戳和微秒数

localtime取得本地时间

date_default_timezone_get(时区)取得一个脚本中所有日期与时间函数所用的默认时区

date_default_timezone_set设定用于一个脚本中所有的日期与时间函数的默认时区

date_sunrise返回给定的日期与地点的日出时间

date_sunset返回给定的日期与地点的日落时间

getdate取得日期 时间信息

 

列子

    上面的方法都是

  <?php

date_default_timezone_get(时区);

echo date("Y-m-d",time());

 

?>

 

你可能感兴趣的:(PHP)