PHP日期与时间相关的函数
2012-07-22 10:47
579 查看
PHP日期和时间 1.验证日期。 checkdate()如果提供的日期有效,返回TRUE,否则返回FALSE。 bool bheckdate(int month,int day,int year); 2.格式化日期。 date()函数返回根据预定义的格式制定的指令格式化的时间和日期的字符串形式。 string date(string format [,int timestamp]); date("F d, Y"); August 22,2007 date("l"); Monday date("m-d-Y"); 07-15-2010 3.了解当前时间的更多信息。(???) gettimeofday()函数返回与当前时间有关的元素所组成的一个关联数组。 mixed gettimeofday([bool return_float); 返回 Array([sec],[usec],[minuteswest],[dsttime]) 4.将时间戳转换为用户友好的值。 array getdate([int timestamp]); 返回 Array([hours],[mday],[minutes],[mon],[month],[seconds],[wday],[weekday],[wday],[weekday],[yday],[year],[0]); 5.确定当前的时间戳。 int time(); 6.根据特定日期和时间创建时间戳。 int mktime([int hour [,int minute [,int second [,int month [,int day [,int year [,int is_dst]]]]]]]); 日期函数。 显示本地化的日期和时间。 7.设置默认的本地化环境。(???) string setlocale(mixed category,string locale [,string locale...]); string setlocale(mixed category,array locale); 8.strftime()函数根据setlocale()制定的本地化设置来格式化日期和时间。 string strftime(string format [,int timestamp]); 9.显示网页的最新修改日期。 int getlastmod(); 10.确定当前月份中的天数。 使用date()的t参数。 date("t"); 11.确定给定月份中的天数。 mktime()与date()合作。 $lastday = mktime(0,0,0,3,0,2007); echo date("t",$lastday); 12.计算当前日期后(前)x天的日期。 strtotime()函数和GNU日期语法(???),加负号表示前x天。 $futuredate = dtrtotime("45 days"); echo date("F d, Y",$futuredate);
相关文章推荐
- PHP扩展之日期和时间相关函数大全
- php自定义函数: 计算两个时间日期相隔的天数,时,分,秒
- PHP - Manual手册 - XXII. Date/Time 日期/时间函数 - date格式化一个本地时间/日期
- 15 个与日期时间相关的精典语句函数
- PHPstorm 函数时间注释的修改 正常的PHPstorm里面函数方法的注释是没有动态时间设置的,但是看了PHP file里面有时间日期的注释,而PHP Function Doc Commen
- PHP与Java对比学习日期时间函数
- MySQL 日期时间相关函数整理
- JS获取时间的相关函数及时间戳与时间日期之间的转换
- 15 个与日期时间相关的精典语句函数
- T-SQL: 17 个与日期时间相关的自定义函数(UDF),周日作为周的最后一天,均不受 @@DateFirst、语言版本影响
- php日期,时间相关知识整理
- T-SQL: 17 个与日期时间相关的自定义函数(UDF),周日作为周的最后一天,均不受 @@DateFirst、语言版本影响
- SAP ABAP 日期,时间 相关函数
- PHP Date()日期时间函数详解
- php Mysql日期和时间函数集合
- PHP中日期和时间函数简介
- php strftime函数获取日期时间(switch用法)
- php获取当日的起止时间和时间相关函数
- 分享几个php时间相关的函数
- php设定用于所有日期时间函数的默认时区。