unix时间戳
date 格式化一个本地时间与日期
time()返回当前的unix时间戳
microtime 返回当前的unix时间戳和微秒数
localtime取得本地时间
立即学习“PHP免费学习笔记(深入)”;
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怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号