PHP 클래스 Neos\Eel\Helper\DateHelper

상속: implements Neos\Eel\ProtectedContextAwareInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

공개 메소드들

메소드 설명
add ( DateTime $date, string | DateInterval $interval ) : DateTime Add an interval to a date and return a new DateTime object
allowsCallOfMethod ( string $methodName ) : boolean All methods are considered safe
dayOfMonth ( DateTimeInterface $dateTime ) : integer Get the day of month of a date
diff ( DateTime $dateA, DateTime $dateB ) : DateInterval Get the difference between two dates as a \DateInterval object
format ( integer | string | DateTime | DateInterval $date, string $format ) : string Format a date (or interval) to a string with a given format
hour ( DateTimeInterface $dateTime ) : integer Get the hour of a date (24 hour format)
minute ( DateTimeInterface $dateTime ) : integer Get the minute of a date
month ( DateTimeInterface $dateTime ) : integer Get the month of a date
now ( ) : DateTime Get the current date and time
parse ( string $string, string $format ) : DateTime Parse a date from string with a format to a DateTime object
second ( DateTimeInterface $dateTime ) : integer Get the second of a date
subtract ( DateTime $date, string | DateInterval $interval ) : DateTime Subtract an interval from a date and return a new DateTime object
today ( ) : DateTime Get the current date
year ( DateTimeInterface $dateTime ) : integer Get the year of a date

메소드 상세

add() 공개 메소드

Add an interval to a date and return a new DateTime object
public add ( DateTime $date, string | DateInterval $interval ) : DateTime
$date DateTime
$interval string | DateInterval
리턴 DateTime

allowsCallOfMethod() 공개 메소드

All methods are considered safe
public allowsCallOfMethod ( string $methodName ) : boolean
$methodName string
리턴 boolean

dayOfMonth() 공개 메소드

Get the day of month of a date
public dayOfMonth ( DateTimeInterface $dateTime ) : integer
$dateTime DateTimeInterface
리턴 integer The day of month of the given date

diff() 공개 메소드

Get the difference between two dates as a \DateInterval object
public diff ( DateTime $dateA, DateTime $dateB ) : DateInterval
$dateA DateTime
$dateB DateTime
리턴 DateInterval

format() 공개 메소드

See formatting options as in PHP date()
public format ( integer | string | DateTime | DateInterval $date, string $format ) : string
$date integer | string | DateTime | DateInterval
$format string
리턴 string

hour() 공개 메소드

Get the hour of a date (24 hour format)
public hour ( DateTimeInterface $dateTime ) : integer
$dateTime DateTimeInterface
리턴 integer The hour of the given date

minute() 공개 메소드

Get the minute of a date
public minute ( DateTimeInterface $dateTime ) : integer
$dateTime DateTimeInterface
리턴 integer The minute of the given date

month() 공개 메소드

Get the month of a date
public month ( DateTimeInterface $dateTime ) : integer
$dateTime DateTimeInterface
리턴 integer The month of the given date

now() 공개 메소드

Examples:: Date.now().timestamp
public now ( ) : DateTime
리턴 DateTime

parse() 공개 메소드

Parse a date from string with a format to a DateTime object
public parse ( string $string, string $format ) : DateTime
$string string
$format string
리턴 DateTime

second() 공개 메소드

Get the second of a date
public second ( DateTimeInterface $dateTime ) : integer
$dateTime DateTimeInterface
리턴 integer The second of the given date

subtract() 공개 메소드

Subtract an interval from a date and return a new DateTime object
public subtract ( DateTime $date, string | DateInterval $interval ) : DateTime
$date DateTime
$interval string | DateInterval
리턴 DateTime

today() 공개 메소드

Get the current date
public today ( ) : DateTime
리턴 DateTime

year() 공개 메소드

Get the year of a date
public year ( DateTimeInterface $dateTime ) : integer
$dateTime DateTimeInterface
리턴 integer The year of the given date