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 Timestamp

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

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

実行時の Timestamp オブジェクトを返します.

実行時の Timestamp オブジェクトを返します.

Parameters

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

Returns

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

Overrides

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

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

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

Parameters

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

Returns

Peach\DT\Timestamp
変換結果

Overrides

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

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

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

Parameters

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

Overrides

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

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

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

Returns

integer
Time::TYPE_TIMESTAMP

Overrides

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

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

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

Returns

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

Overrides

Peach\DT\Datetime::formatTime()
public Peach\DT\Timestamp
# toTimestamp( )

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

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

Returns

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

Overrides

Peach\DT\Datetime::toTimestamp()
Methods inherited from Peach\DT\Datetime
__toString(), toDatetime()
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
Properties summary
protected integer $second

秒を表す整数です.

秒を表す整数です.

# 0
PEACH2 API documentation generated by ApiGen