DateTime
class System\Helpers\DateTime
Methods
public
static
makeCarbon ($value, boolean $throwException = true
)
: Carbon\Carbon
Converts mixed inputs to a Carbon object.
Parameters
Property | Type | Description |
---|---|---|
$value | mixed |
mixed
|
$throwException | boolean |
boolean
|
Returns
Carbon\Carbon
public static momentFormat (string $format) : string
Converts a PHP date format to "Moment.js" format.
Parameters
Property | Type | Description |
---|---|---|
$format | string |
string
|
Returns
string
public static timeSince ($datetime) : string
Returns a human readable time difference from the value to the current time. Eg: 10 minutes ago
Parameters
Property | Type | Description |
---|---|---|
$datetime | mixed |
mixed
|
Returns
string
public static timeTense ($datetime) : 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.
Parameters
Property | Type | Description |
---|---|---|
$datetime | mixed |
mixed
|
Returns
string
Copyright © 2024 Winter CMS