System\Helpers\DateTime

Public methods

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

Converts mixed inputs to a Carbon object.

Parameters
  • $value
  • $throwException

public static string momentFormat(string $format)

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

Parameters
  • string $format

public static string timeSince($datetime)

Returns a human readable time difference from the value to the current time. Eg: 10 minutes ago

Parameters
  • $datetime

public static string timeTense($datetime)

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
  • $datetime