class Time

Time helper class

Methods

static datetime
toSqlDateTime(integer $time = null)

Take a timestamp and return a properly formatted SQL datetime string

static object
fromSqlTime(datetime $time)

Take a SQL DateTime and return a Carbon DT object

static object
fromUnixTime(datetime $time)

Take a Unix Timestamp and return a Carbon DT object

static object
fromString($time = 'now', $format = null)

Get a Carbon DT object for a given time and format

static object
fromLocalString($time = 'now', $format = null)

Get a Carbon DT object for a given time and format in local time

Details

at line 19
static datetime toSqlDateTime(integer $time = null)

Take a timestamp and return a properly formatted SQL datetime string

Parameters

integer $time

Return Value

datetime

at line 37
static object fromSqlTime(datetime $time)

Take a SQL DateTime and return a Carbon DT object

Parameters

datetime $time DateTime

Return Value

object Carbon

at line 50
static object fromUnixTime(datetime $time)

Take a Unix Timestamp and return a Carbon DT object

Parameters

datetime $time DateTime

Return Value

object Carbon

at line 60
static object fromString($time = 'now', $format = null)

Get a Carbon DT object for a given time and format

Parameters

$time
$format

Return Value

object Carbon

at line 74
static object fromLocalString($time = 'now', $format = null)

Get a Carbon DT object for a given time and format in local time

Parameters

$time
$format

Return Value

object Carbon