Overview

Namespaces

  • Peach
    • DF
    • DT
    • Http
      • Body
      • Header
    • Markup
    • Util

Classes

  • AbstractTime
  • Clock
  • Date
  • Datetime
  • DefaultClock
  • FixedClock
  • FormatWrapper
  • HttpDateFormat
  • OffsetClock
  • ShiftFormat
  • SimpleFormat
  • TimeEquator
  • Timestamp
  • TimeWrapper
  • UnixTimeFormat
  • Util
  • W3cDatetimeFormat

Interfaces

  • Format
  • Time
  • Overview
  • Namespace
  • Class

Class Datetime

DATETIME 型の時間オブジェクトです. このクラスは年・月・日・時・分のフィールドをサポートします.

Peach\DT\AbstractTime implements Peach\DT\Time
Extended by Peach\DT\Date
Extended by Peach\DT\Datetime

Direct known subclasses

Peach\DT\Timestamp
Namespace: Peach\DT
Located at Peach/DT/Datetime.php
Methods summary
public static Peach\DT\Datetime
# now( Peach\DT\Clock $clock = null )

現在時刻の Datetime オブジェクトを返します.

現在時刻の Datetime オブジェクトを返します.

Parameters

$clock
現在時刻を取得するための Clock オブジェクト

Returns

Peach\DT\Datetime
現在時刻をあらわす Datetime

Overrides

Peach\DT\Date::now()
public static Peach\DT\Datetime
# parse( string $text, Peach\DT\Format $format = null )

指定されたテキストを解析して Datetime オブジェクトに変換します. $format が指定されていない場合は W3cDatetimeFormat::getInstance を使って解析を行います. ("YYYY-MM-DD hh:mm" 形式の文字列を受理します. 日付と時刻のセパレータは, 数字以外の ASCII 1 文字であれば何でも構いません.)

指定されたテキストを解析して Datetime オブジェクトに変換します. $format が指定されていない場合は W3cDatetimeFormat::getInstance を使って解析を行います. ("YYYY-MM-DD hh:mm" 形式の文字列を受理します. 日付と時刻のセパレータは, 数字以外の ASCII 1 文字であれば何でも構いません.)

Parameters

$text
変換対象の文字列
$format
変換に使用するフォーマット

Returns

Peach\DT\Datetime
変換結果

Overrides

Peach\DT\Date::parse()
public
# __construct( integer $year, integer $month, integer $date, integer $hour, integer $min )

与えられた時刻を表現する Datetime オブジェクトを構築します.

与えられた時刻を表現する Datetime オブジェクトを構築します.

Parameters

$year
年
$month
月
$date
日
$hour
時
$min
分

Overrides

Peach\DT\Date::__construct()
public integer
# getType( )

このオブジェクトの型 Time::TYPE_DATETIME を返します.

このオブジェクトの型 Time::TYPE_DATETIME を返します.

Returns

integer
Time::TYPE_DATETIME

Overrides

Peach\DT\Date::getType()
public string
# formatTime( )

このオブジェクトの時刻部分の文字列を "hh:mm" 形式で返します.

このオブジェクトの時刻部分の文字列を "hh:mm" 形式で返します.

Returns

string
"hh:mm" 形式の文字列

Overrides

Peach\DT\AbstractTime::formatTime()
public string
# __toString( )

このオブジェクトの文字列表現です. "YYYY-MM-DD hh:mm" 形式の文字列を返します.

このオブジェクトの文字列表現です. "YYYY-MM-DD hh:mm" 形式の文字列を返します.

Returns

string
W3CDTF に則った文字列表現

Overrides

Peach\DT\Date::__toString()
public Peach\DT\Datetime
# toDatetime( )

このオブジェクトを Datetime 型にキャストします. 返り値はこのオブジェクトのクローンです.

このオブジェクトを Datetime 型にキャストします. 返り値はこのオブジェクトのクローンです.

Returns

Peach\DT\Datetime
このオブジェクトのクローン

Overrides

Peach\DT\Date::toDatetime()
public Peach\DT\Timestamp
# toTimestamp( )

このオブジェクトを Timestamp 型にキャストします. この時刻の 0 秒を表す Timestamp オブジェクトを返します.

このオブジェクトを Timestamp 型にキャストします. この時刻の 0 秒を表す Timestamp オブジェクトを返します.

Returns

Peach\DT\Timestamp
このオブジェクトの timestamp 表現

Overrides

Peach\DT\Date::toTimestamp()
Methods inherited from Peach\DT\Date
getDateCount(), getDay(), isLeapYear(), toDate()
Methods inherited from Peach\DT\AbstractTime
add(), after(), before(), compareTo(), equals(), format(), get(), set(), setAll()
Constants inherited from Peach\DT\Time
FRIDAY, MONDAY, SATURDAY, SUNDAY, THURSDAY, TUESDAY, TYPE_DATE, TYPE_DATETIME, TYPE_TIMESTAMP, WEDNESDAY
PEACH2 API documentation generated by ApiGen