DateTime

 class System\Helpers\DateTime

Methods

public static makeCarbon ($value, boolean $throwException = true) : Carbon\Carbon

Converts mixed inputs to a Carbon object.

Parameters
Property Description
$value
mixed
$throwException
boolean
Returns
Carbon\Carbon

public static momentFormat (string $format) : string

Converts a PHP date format to "Moment.js" format.

Parameters
Property Description
$format
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 Description
$datetime
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 Description
$datetime
mixed
Returns
string
Copyright © 2024 Winter CMS