static string dateAdd(
string
$interval, int
$value, string
$dateTime, [mixed
$format = null]
)
|
|
返回向指定日期追加指定间隔类型的一段时间间隔后的日期
Parameters:
string |
$interval: |
字符串表达式,是所要加上去的时间间隔类型。 |
int |
$value: |
数值表达式,是要加上的时间间隔的数目。其数值可以为正数(得到未来的日期),也可以为负数(得到过去的日期)。 |
string |
$dateTime: |
表示日期的文字,这一日期还加上了时间间隔。 |
mixed |
$format: |
格式化输出 |
API Tags:
Return: | 返回追加后的时间 |
Access: | public |
static string dateDiff(
string
$interval, mixed
$startDateTime, mixed
$endDateTime
)
|
|
获取两个日期的差
Parameters:
string |
$interval: |
返回两个日期差的间隔类型 |
mixed |
$startDateTime: |
开始日期 |
mixed |
$endDateTime: |
结束日期 |
API Tags:
static string datePart(
string
$interval, [mixed
$dateTime = null]
)
|
|
获取日期的某部分
Parameters:
string |
$interval: |
字符串表达式 ,时间间隔类型 |
mixed |
$dateTime: |
表示日期的文字,默认为null则用当前时间 |
API Tags:
Return: | 返回日期的某部分 |
Access: | public |
static string format(
[string
$format = null], [int
$dateTime = null]
)
|
|
格式化输出
Parameters:
string |
$format: |
目标格式,默认为null则以Y-m-d H:i:s格式输出 |
int |
$dateTime: |
unix时间戳,默认为null则用当前时间 |
API Tags:
static string getChinaDate(
[int
$time = null]
)
|
|
取得中国日期时间
Parameters:
int |
$time: |
需要使用的时间戳,默认为null则获取当前时间戳 |
API Tags:
static string getChinaWeek(
[int
$week = null]
)
|
|
取得中国的星期
Parameters:
int |
$week: |
处国人的星期,是一个数值,默认为null则使用当前时间 |
API Tags:
static int getDaysInMonth(
int
$month, int
$year
)
|
|
获取该月的天数
Parameters:
int |
$month: |
月份 |
int |
$year: |
年份 |
API Tags:
static int getDaysInYear(
$year
)
|
|
获取该年的天数
Parameters:
API Tags:
static array getLastDate(
int
$time, [int
$timestamp = null], [string
$format = null], [array
$type = 1]
)
|
|
比较两个时间返回离现在最近的一个时间
Parameters:
int |
$time: |
当前时间戳 |
int |
$timestamp: |
比较的时间戳,默认为null则获取当前时间戳 |
string |
$format: |
格式化当前时间戳,默认为null则转化为格式Y-m-d H:i:s |
array |
$type: |
要返回的时间类型,默认为 1则只返回Y-m-d否则返回Y-m-d m-d H:i |
API Tags:
static int getMicroTime(
[string
$mircrotime = null], [string
$get_as_float = false]
)
|
|
获取微秒数
Parameters:
string |
$mircrotime: |
微妙时间,默认为null则获取当前时间 |
string |
$get_as_float: |
获取微妙时间是否以浮点数返回,默认为false即不以浮点数方式返回 |
API Tags:
static string getPeriodOfTime(
[int
$hour = null]
)
|
|
取得一天中的时段
Parameters:
int |
$hour: |
小时,默认为null则获取当前时间 |
API Tags:
static array getRealDaysInMonthsOfYear(
string
$year
)
|
|
得到一年中每个月真实的天数
Parameters:
string |
$year: |
需要获得的月份天数的年份 |
API Tags:
Return: | 每月的天数组成的数组 |
Access: | public |
static string getRFCDate(
[
$date = null], string
$data
)
|
|
取得RFC格式的日期与时间
Parameters:
string |
$data: |
需要获取的时间,默认为null则获取当前时间 |
|
$date: |
|
API Tags:
static int getTimeStamp(
[int
$dateTime = null]
)
|
|
获得时间戳
Parameters:
int |
$dateTime: |
时间戳,默认为null则以当前时间戳返回 |
API Tags:
static string getTimeZone(
)
|
|
获取时区
API Tags:
static string getUTCDate(
[mixed
$dateTime = null]
)
|
|
获取UTC日期格式
Parameters:
mixed |
$dateTime: |
时间,默认为null则获取当前时间 |
API Tags:
static boolean isLeapYear(
int
$year
)
|
|
判断是否是闰年
Parameters:
API Tags:
Return: | 如果是润年则返回true |
Access: | public |
static void setTimezone(
string
$timezone
)
|
|
设置时区
Parameters:
API Tags: