日付計算
static
object 加算結果
addDate
(object $date, integer $diff, string $unit)
-
object
$date: 計算の基準日
-
integer
$diff: 加算する日数、月数、年数
-
string
$unit: 単位をあらわす文字 y,m,d
日数加算
static
object 加算後の日付
addDays
(object $d, integer $days)
-
object
$d: 日付
-
integer
$days: 加算日数
月数加算
static
object 加算後の日付
addMonths
(object $d, integer $months)
-
object
$d: 日付
-
integer
$months: 加算月数
年加算
static
object 加算後の日付
addYears
(object $d, integer $years)
-
object
$d: 日付
-
integer
$years: 加算年数
年齢(月)
static
integer
ageMonth
(object $birthday, object $baseDate)
-
object
$birthday: 誕生日
-
object
$baseDate: 基準日
基準日と生年月日から99Y(24ヶ月以上)または99M(24ヶ月未満)の文字列を得る
static
string
ageString
(object $birthday, object $baseDate)
-
object
$birthday: 誕生日
-
object
$baseDate: 基準日
基準日と生年月日から99歳または99ヶ月(24ヶ月未満)の文字列を得る
static
string
ageStringJP
(object $birthday, object $baseDate)
-
object
$birthday: 誕生日
-
object
$baseDate: 基準日
年齢
static
integer
ageYear
(object $birthday, object $baseDate)
-
object
$birthday: 誕生日
-
object
$baseDate: 基準日
年、月、日の要素から日付生成
static
指定年月日から成る日付
create
(integer $y, integer $m, integer $d)
-
integer
$y: 年をあらわす数値
-
integer
$m: 月をあらわす数値
-
integer
$d: 日をあらわす数値
月日の要素から日付生成
年は基準日以降の最初の年を仮定
static
object 指定月日でかつ基準日以降の日付
createFromMonthDay
(integer $m, integer $d)
-
integer
$m: 月をあらわす数値
-
integer
$d: 日をあらわす数値
年、月の要素から日付生成
日は1日を仮定
static
指定年月+1日の日付
createFromYearMonth
(integer $y, integer $m)
-
integer
$y: 年をあらわす数値
-
integer
$m: 月をあらわす数値
年推論の基準にする日付
static
object 年推論の基準にする日付
dateToSuggestYear
()
static
void
dayOfWeek
( $date)
曜日のインデックス(weekDayBaseから始まる).
曜日の基準(weekDayBase)により1-7または0-6
static
integer
dayOfWeekIndex
(object $object)
曜日文字列
static
string
dayOfWeekString
(object $object)
曜日文字列
static
string
dayOfWeekStringJP
(object $object)
日数計算
static
$intDiff
diffDays
(object $d1, object $d2)
-
object
$d1: 基準日
-
object
$d2: 比較対象日
指定日付の月の月末
static
object 指定日付の月の月末
endOfMonth
(object $d)
何ヶ月か後の月末
static
object 指定年月のafterヶ月後の月末
endOfMonthAfter
(integer $year, integer $month, integer $after)
-
integer
$year: 年
-
integer
$month: 月
-
integer
$after: 加算する月数
指定月の月末
static
object 指定年月の月末
endOfYearMonth
(integer $year, integer $month)
-
integer
$year: 指定年
-
integer
$month: 指定月
Date型をString型にして出力
static
string
format
(datetime $date, [string $formatString = CFW_Constants_DateTime::FORMAT_DATE_TIME])
-
datetime
$date: 変換対象DateTime型
-
string
$formatString: フォーマット方式
static
void
hour
( $date)
年推論
static
object 年推論の基準にする日付以降でもっとも現在に近い日付
inferYear
(object $d)
指定日より後か
static
boolean
isAfter
(object $d1, object $d2)
-
object
$d1: 対象日
-
object
$d2: 基準日
指定日より後か同じか
static
boolean
isAfterOrSame
(object $d1, object $d2)
-
object
$d1: 対象日
-
object
$d2: 基準日
指定日より前か
static
boolean
isBefore
(object $d1, object $d2)
-
object
$d1: 対象日
-
object
$d2: 基準日
指定日より前か同じか
static
boolean
isBeforeOrSame
(object $d1, object $d2)
-
object
$d1: 対象日
-
object
$d2: 基準日
月末チェック
static
boolean
isEndOfMonth
(object $d)
範囲の正当性を検証
static
boolean
isInRange
(object $object, object $min, object $max)
-
object
$object: 検証する対象
-
object
$min: 範囲(最小値)
-
object
$max: 範囲(最大値)
指定日と同じか
static
boolean
isSame
(object $d1, object $d2)
-
object
$d1: 対象日
-
object
$d2: 基準日
static
void
minute
( $date)
static
void
month
( $date)
何ヶ月か後
static
object 指定年月のafterヶ月後の月初
monthAfter
(integer $year, integer $month, integer $after)
-
integer
$year: 年
-
integer
$month: 月
-
integer
$after: 加算する月数
次の月
static
object 指定年月の翌月の1日
nextMonth
(integer $year, integer $month)
-
integer
$year: 年
-
integer
$month: 月
現在(時刻を含む)
static
現在(時刻を含む)
now
()
文字列を解析して日付型に変換
static
object 解析結果の日付。解析エラーの場合null
parse
(string $s)
前の月
static
object 指定年月の昨月の1日
previousMonth
(integer $year, integer $month)
-
integer
$year: 年
-
integer
$month: 月
static
void
second
( $date)
Dateが期待される値をDateTimeに
static
Date
toDate
($value $value)
-
$value
$value: 変換する対象の文字列型の式
今日(時刻を含まない= 0時0分)
static
今日(時刻を含まない=
today
()
時刻を捨てる
static
指定日付の0時0分を表す日付
truncateTime
(object $object)
static
void
year
( $date)