本文共 1861 字,大约阅读时间需要 6 分钟。
getdate函数
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/