PHP 클래스 Ouzo\Utilities\Clock

파일 보기 프로젝트 열기: letsdrink/ouzo 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dateTime
$freeze
$freezeDate DateTim\DateTime | Clock

공개 메소드들

메소드 설명
__construct ( DateTime $dateTime )
at ( $date ) : Clock Obtains a Clock set to to a specific point.
format ( $format = null )
freeze ( null $date = null ) Freezes time to a specific point or current time if no time is given.
fromTimestamp ( $timestamp ) : Clock Obtains a Clock set to to a specific point using Unix timestamp.
getTimestamp ( )
isAfter ( Clock $other )
isAfterOrEqualTo ( Clock $other )
isBefore ( Clock $other )
isBeforeOrEqualTo ( Clock $other )
minusDays ( $days )
minusHours ( $hours )
minusMinutes ( $minutes )
minusMonths ( $months )
minusSeconds ( $seconds )
minusYears ( $years )
now ( ) : Clock Obtains a Clock set to the current time.
nowAsString ( string $format = null ) : string Returns current time as a string.
plusDays ( $days )
plusHours ( $hours )
plusMinutes ( $minutes )
plusMonths ( $months )
plusSeconds ( $seconds )
plusYears ( $years )
setTimezone ( $timezone )
toDateTime ( ) : DateTime Converts this object to a DateTime

비공개 메소드들

메소드 설명
_modify ( $interval )

메소드 상세

__construct() 공개 메소드

public __construct ( DateTime $dateTime )
$dateTime DateTime

at() 공개 정적인 메소드

Obtains a Clock set to to a specific point.
public static at ( $date ) : Clock
$date
리턴 Clock

format() 공개 메소드

public format ( $format = null )

freeze() 공개 정적인 메소드

Freezes time to a specific point or current time if no time is given.
public static freeze ( null $date = null )
$date null

fromTimestamp() 공개 정적인 메소드

Obtains a Clock set to to a specific point using Unix timestamp.
public static fromTimestamp ( $timestamp ) : Clock
$timestamp
리턴 Clock

getTimestamp() 공개 메소드

public getTimestamp ( )

isAfter() 공개 메소드

public isAfter ( Clock $other )
$other Clock

isAfterOrEqualTo() 공개 메소드

public isAfterOrEqualTo ( Clock $other )
$other Clock

isBefore() 공개 메소드

public isBefore ( Clock $other )
$other Clock

isBeforeOrEqualTo() 공개 메소드

public isBeforeOrEqualTo ( Clock $other )
$other Clock

minusDays() 공개 메소드

public minusDays ( $days )

minusHours() 공개 메소드

public minusHours ( $hours )

minusMinutes() 공개 메소드

public minusMinutes ( $minutes )

minusMonths() 공개 메소드

public minusMonths ( $months )

minusSeconds() 공개 메소드

public minusSeconds ( $seconds )

minusYears() 공개 메소드

public minusYears ( $years )

now() 공개 정적인 메소드

Obtains a Clock set to the current time.
public static now ( ) : Clock
리턴 Clock

nowAsString() 공개 정적인 메소드

Example: Clock::freeze('2011-01-02 12:34'); $result = Clock::nowAsString('Y-m-d'); Result: 2011-01-02
public static nowAsString ( string $format = null ) : string
$format string
리턴 string

plusDays() 공개 메소드

public plusDays ( $days )

plusHours() 공개 메소드

public plusHours ( $hours )

plusMinutes() 공개 메소드

public plusMinutes ( $minutes )

plusMonths() 공개 메소드

public plusMonths ( $months )

plusSeconds() 공개 메소드

public plusSeconds ( $seconds )

plusYears() 공개 메소드

public plusYears ( $years )

setTimezone() 공개 메소드

public setTimezone ( $timezone )

toDateTime() 공개 메소드

Converts this object to a DateTime
public toDateTime ( ) : DateTime
리턴 DateTime

프로퍼티 상세

$dateTime 공개적으로 프로퍼티

public $dateTime

$freeze 공개적으로 정적으로 프로퍼티

public static $freeze

$freezeDate 공개적으로 정적으로 프로퍼티

public static DateTime,DateTim|Clock,Ouzo\Utilities $freezeDate
리턴 DateTim\DateTime | Clock