DateTimeTransformer
in package
Class DateTimeTransformer
Tags
Table of Contents
Constants
- FORMAT_DATE = 'Y-m-d'
- FORMAT_DATE_TIME = 'Y-m-d H:i:s'
- FORMAT_TIME = 'H:i:s'
Methods
- create() : DateTime
- Converts provided date and time string to DateTime from format used in the system.
- createDate() : DateTime
- Converts provided date string to DateTime from format used in the system.
- createTime() : DateTime
- Converts provided time string to DateTime from format used in the system.
- format() : string
- Converts provided DateTimeInterface instance to date and time format used in the system.
- formatDate() : string
- Converts provided DateTimeInterface instance to date format used in the system.
- formatTime() : string
- Converts provided DateTimeInterface instance to time format used in the system.
Constants
FORMAT_DATE
public
mixed
FORMAT_DATE
= 'Y-m-d'
FORMAT_DATE_TIME
public
mixed
FORMAT_DATE_TIME
= 'Y-m-d H:i:s'
FORMAT_TIME
public
mixed
FORMAT_TIME
= 'H:i:s'
Methods
create()
Converts provided date and time string to DateTime from format used in the system.
public
static create(string $dateTime) : DateTime
Parameters
- $dateTime : string
Tags
Return values
DateTimecreateDate()
Converts provided date string to DateTime from format used in the system.
public
static createDate(string $date) : DateTime
Parameters
- $date : string
Tags
Return values
DateTimecreateTime()
Converts provided time string to DateTime from format used in the system.
public
static createTime(string $time) : DateTime
Parameters
- $time : string
Tags
Return values
DateTimeformat()
Converts provided DateTimeInterface instance to date and time format used in the system.
public
static format(DateTimeInterface $dateTime) : string
Parameters
- $dateTime : DateTimeInterface
Return values
stringformatDate()
Converts provided DateTimeInterface instance to date format used in the system.
public
static formatDate(DateTimeInterface $dateTime) : string
Parameters
- $dateTime : DateTimeInterface
Return values
stringformatTime()
Converts provided DateTimeInterface instance to time format used in the system.
public
static formatTime(DateTimeInterface $dateTime) : string
Parameters
- $dateTime : DateTimeInterface