博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
getdate函数_PHP getdate()函数与示例
阅读量:2527 次
发布时间:2019-05-11

本文共 1861 字,大约阅读时间需要 6 分钟。

getdate函数

PHP getdate()函数 (PHP getdate() function)

getdate() function is used to get the local date/time (or it is also used to get the date/time based on the given timestamp.

getdate()函数用于获取本地日期/时间(或也用于根据给定的时间戳获取日期/时间。

Syntax:

句法:

getdate(timestamp);

Parameter(s):

参数:

  • timestamp – It is an optional parameter which specifies the timestamp (which is based on an integer UNIX timestamp) – if we do not pass the timestamp the function returns the local date/time.

    timestamp –这是一个可选参数,用于指定时间戳(基于整数UNIX时间戳)–如果不传递时间戳,该函数将返回本地日期/时间。

Timestamps: Following are the timestamps,

时间戳记 :以下是时间戳记,

  • seconds - it is used to get the time in seconds

    秒 -用于获取时间(以秒为单位)

  • minutes - it is used to get the time in minutes

    分钟 -用于获取以分钟为单位的时间

  • hours - it is used to get the time in hours

    小时 -用于获取小时数

  • mday - it is used to get the day of the month

    mday-用于获取每月的某天

  • wday - it is used to get the day of the week

    wday-用于获取星期几

  • mon - it is used to get the month

    mon-用于获取月份

  • year - it is used to get the year

    年 -用于获取年份

  • yday - it is used to get the day of the year

    yday-用于获取一年中的某天

  • weekday - it is used to get the name of the week

    工作日 -用于获取星期名称

  • month - it is used to get the name of the month

    month-用于获取月份的名称

  • 0 - it is used to get the seconds since Unix Epoch

    0-用于获取自Unix Epoch以来的秒数

Return value:

返回值:

It returns an array of the date/time information with the timestamp

它返回带有时间戳的日期/时间信息数组

Example: PHP code to demonstrate the example of getdate() function

示例:PHP代码演示getdate()函数的示例

Output

输出量

getdate() result...Array(    [seconds] => 28    [minutes] => 56    [hours] => 12    [mday] => 13    [wday] => 2    [mon] => 8    [year] => 2019    [yday] => 224    [weekday] => Tuesday    [month] => August    [0] => 1565700988)seconds:  28minutes:  56hours:    12mday:     13wday:     2mon:      8year:     2019yday:     224weekday:  Tuesdaymonth:    August0:        1565700988

Reference:

参考:

翻译自:

getdate函数

转载地址:http://cmxzd.baihongyu.com/

你可能感兴趣的文章
02-环境搭建
查看>>
spring第二冲刺阶段第七天
查看>>
搜索框键盘抬起事件2
查看>>
阿里百川SDK初始化失败 错误码是203
查看>>
透析Java本质-谁创建了对象,this是什么
查看>>
BFS和DFS的java实现
查看>>
关于jquery中prev()和next()的用法
查看>>
一、 kettle开发、上线常见问题以及防错规范步骤
查看>>
eclipse没有server选项
查看>>
CRC码计算及校验原理的最通俗诠释
查看>>
QTcpSocket的连续发送数据和连续接收数据
查看>>
使用Gitbook来编写你的Api文档
查看>>
jquery扩展 $.fn
查看>>
tomcat 多实例的Sys V风格脚本
查看>>
程序员如何讲清楚技术方案
查看>>
MapReduce-实践1
查看>>
UVa 815 - Flooded!
查看>>
jQuery基础--选择器
查看>>
mybatis使用collection查询集合属性规则
查看>>
Markdown指南
查看>>