分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

php日期时间函数

发布时间:2023-09-06 01:14责任编辑:胡小海关键词:暂无标签

日期时间函数
① time函数
主要功能:返回格林制时间(1970-1-1 0:0:0)到当前时间的秒数(时间戳)
② date函数
基本语法:
string date ( string $format [, int $timestamp ] )
主要功能:返回格式化后的时间格式
参数说明:
$format:要格式化的参数(如Y-m-d H:i:s)
Y(Year)缩写:年份
m(month)缩写:月份
d(day)缩写:日
H(Hour)缩写:小时
i(minute)缩写,但是为了防止与(month)冲突,所以采用i代表分钟
s(seconds)缩写,秒
$timestamp :时间戳
③ strtotime函数
基本语法:
int strtotime ( string $time [, int $now = time() ] )
主要功能:将日期格式转化生成unix时间戳
参数说明:
$time:要转化的日期格式
$now:可选参数,默认显示当前时间的时间戳
④ microtime函数
基本语法:
mixed microtime ([ bool $get_as_float ] )
主要功能:返回当前时间的unix时间戳与微秒数
参数说明:
$get_as_float :布尔类型的值,如果此值为true,则返回一个float浮点数

php日期时间函数

原文地址:http://www.cnblogs.com/header/p/7599445.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved