Documentation

Time
in package

Time helper class

Table of Contents

fromLocalString()  : object
Get a Carbon DT object for a given time and format in local time
fromSqlTime()  : object
Take a SQL DateTime and return a Carbon DT object
fromString()  : object
Get a Carbon DT object for a given time and format
fromUnixTime()  : object
Take a Unix Timestamp and return a Carbon DT object
toSqlDateTime()  : datetime
Take a timestamp and return a properly formatted SQL datetime string

Methods

fromLocalString()

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

public static fromLocalString([datetime $time = 'now' ][, mixed $format = null ]) : object
Parameters
$time : datetime = 'now'

DateTime

$format : mixed = null
Return values
object

Carbon

fromSqlTime()

Take a SQL DateTime and return a Carbon DT object

public static fromSqlTime(datetime $time) : object
Parameters
$time : datetime

DateTime

Return values
object

Carbon

fromString()

Get a Carbon DT object for a given time and format

public static fromString([datetime $time = 'now' ][, mixed $format = null ]) : object
Parameters
$time : datetime = 'now'

DateTime

$format : mixed = null
Return values
object

Carbon

fromUnixTime()

Take a Unix Timestamp and return a Carbon DT object

public static fromUnixTime(datetime $time) : object
Parameters
$time : datetime

DateTime

Return values
object

Carbon

toSqlDateTime()

Take a timestamp and return a properly formatted SQL datetime string

public static toSqlDateTime([int $time = null ]) : datetime
Parameters
$time : int = null
Return values
datetime

Search results