Class Date

Description

日期时间操作类

Located in /ORG/Date/Date.class.php (line 25)

Base
   |
   --Date
Variable Summary
string $CDATE
string $cMonth
string $CTIME
string $cWeekday
integer $date
integer $day
integer $hour
integer $minute
integer $month
integer $second
integer $timezone
mixed $Week
integer $weekday
integer $yDay
integer $year
string $YMD
Method Summary
static Date __construct ([mixed $date = ''])
static integer dateDiff (mixed $date, [string $elaps = "d"])
static string isLeapYear ()
static string magicInfo (string $type)
static string numberToCh (integer $number)
static string parse (mixed $date)
static void setDate (integer $date)
static string timeDiff (mixed $time, [mixed $precision = false])
static string yearToCh (integer $yearStr, [boolean $flag = false])
string dateAdd ([integer $number = 0], [string $interval = "d"])
string firstDayOfMonth ()
string firstDayOfYear ()
string format ([string $format = "%Y-%m-%d %H:%M:%S"])
string lastDayOfMonth ()
string lastDayOfYear ()
integer maxDayOfMonth ()
string valid (mixed $date)
void __toString ()
Variables
string $CDATE (line 156)

日期CDATE表示

  • access: protected
string $cMonth (line 146)

月份的完整表示

  • access: protected
string $CTIME (line 176)

时间的输出表示

  • access: protected
string $cWeekday (line 126)

星期的完整表示

  • access: protected
integer $date (line 36)

日期的时间戳

  • access: protected
integer $day (line 76)

日

  • access: protected
integer $hour (line 86)

时

  • access: protected
integer $minute (line 96)

分

  • access: protected
integer $month (line 66)

月

  • access: protected
integer $second (line 106)

秒

  • access: protected
integer $timezone (line 46)

时区

  • access: protected
mixed $Week = array("日","一","二","三","四","五","六") (line 177)
  • access: protected
integer $weekday (line 116)

星期的数字表示

  • access: protected
integer $yDay (line 136)

一年中的天数 0-365

  • access: protected
integer $year (line 56)

年

  • access: protected
string $YMD (line 166)

日期的YMD表示

  • access: protected
Methods
static __construct (line 190)

架构函数

创建一个Date对象

  • access: public
static Date __construct ([mixed $date = ''])
  • mixed $date: 日期
static dateDiff (line 355)

计算日期差

w - weeks d - days h - hours m - minutes s - seconds

  • throws: ThinkExecption
  • access: public
static integer dateDiff (mixed $date, [string $elaps = "d"])
  • mixed $date: 要比较的日期
  • string $elaps: 比较跨度
static isLeapYear (line 329)

是否为闰年

  • throws: ThinkExecption
  • access: public
static string isLeapYear ()
static magicInfo (line 686)

判断日期 所属 干支 生肖 星座 type 参数:XZ 星座 GZ 干支 SX 生肖

  • throws: ThinkExecption
  • access: public
static string magicInfo (string $type)
  • string $type: 获取信息类型
static numberToCh (line 623)

日期数字转中文

用于日和月、周

  • throws: ThinkExecption
  • access: public
static string numberToCh (integer $number)
  • integer $number: 日期数字
static parse (line 212)

日期分析

返回时间戳

  • throws: ThinkExecption
  • access: public
static string parse (mixed $date)
  • mixed $date: 日期
static setDate (line 276)

日期参数设置

  • throws: ThinkExecption
  • access: public
static void setDate (integer $date)
  • integer $date: 日期时间戳
static timeDiff (line 403)

人性化的计算日期差

  • throws: ThinkExecption
  • access: public
static string timeDiff (mixed $time, [mixed $precision = false])
  • mixed $time: 要比较的时间
  • mixed $precision: 返回的精度
static yearToCh (line 661)

年份数字转中文

  • throws: ThinkExecption
  • access: public
static string yearToCh (integer $yearStr, [boolean $flag = false])
  • integer $yearStr: 年份数字
  • boolean $flag: 是否显示公元
dateAdd (line 545)

取得指定间隔日期

yyyy - 年 q - 季度 m - 月 y - day of year d - 日 w - 周 ww - week of year h - 小时 n - 分钟 s - 秒

  • throws: ThinkExecption
  • access: public
string dateAdd ([integer $number = 0], [string $interval = "d"])
  • integer $number: 间隔数目
  • string $interval: 比较类型
firstDayOfMonth (line 438)

计算月份的第一天

返回Date对象

  • throws: ThinkExecption
  • access: public
string firstDayOfMonth ()
firstDayOfYear (line 457)

计算年份的第一天

返回Date对象

  • throws: ThinkExecption
  • access: public
string firstDayOfYear ()
format (line 313)

日期格式化

默认返回 1970-01-01 11:30:45 格式

  • throws: ThinkExecption
  • access: public
string format ([string $format = "%Y-%m-%d %H:%M:%S"])
  • string $format: 格式化参数
lastDayOfMonth (line 476)

计算月份的最后一天

返回Date对象

  • throws: ThinkExecption
  • access: public
string lastDayOfMonth ()
lastDayOfYear (line 495)

计算年份的最后一天

返回Date对象

  • throws: ThinkExecption
  • access: public
string lastDayOfYear ()
maxDayOfMonth (line 514)

计算月份的最大天数

  • throws: ThinkExecption
  • access: public
integer maxDayOfMonth ()
valid (line 256)

验证日期数据是否有效

  • throws: ThinkExecption
  • access: public
string valid (mixed $date)
  • mixed $date: 日期数据
__toString (line 727)
  • access: public
void __toString ()

Documentation generated on Thu, 27 Mar 2008 08:20:29 +0000 by 塞北的雪