DateTime
in package
Table of Contents
- makeCarbon() : Carbon
- Converts mixed inputs to a Carbon object.
- momentFormat() : string
- Converts a PHP date format to "Moment.js" format.
- timeSince() : string
- Returns a human readable time difference from the value to the current time. Eg: **10 minutes ago**
- timeTense() : string
- Returns 24-hour time and the day using the grammatical tense of the current time. Eg: Today at 12:49, Yesterday at 4:00 or 18 Sep 2015 at 14:33.
Methods
makeCarbon()
Converts mixed inputs to a Carbon object.
public
static makeCarbon(mixed $value[, mixed $throwException = true ]) : Carbon
Parameters
- $value : mixed
- $throwException : mixed = true
Return values
Carbon —momentFormat()
Converts a PHP date format to "Moment.js" format.
public
static momentFormat(string $format) : string
Parameters
- $format : string
Return values
string —timeSince()
Returns a human readable time difference from the value to the current time. Eg: **10 minutes ago**
public
static timeSince(mixed $datetime) : string
Parameters
- $datetime : mixed
Return values
string —timeTense()
Returns 24-hour time and the day using the grammatical tense of the current time. Eg: Today at 12:49, Yesterday at 4:00 or 18 Sep 2015 at 14:33.
public
static timeTense(mixed $datetime) : string
Parameters
- $datetime : mixed