Timestamp
Trait Timestamp.
Table of Contents
- createFromTimestamp() : static
- Create a Carbon instance from a timestamp.
- createFromTimestampMs() : static
- Create a Carbon instance from a timestamp in milliseconds.
- createFromTimestampUTC() : static
- Create a Carbon instance from an UTC timestamp.
- getPreciseTimestamp() : float
- Returns a timestamp rounded with the given precision (6 by default).
- timestamp() : static
- Set the instance's timestamp.
- unix() : int
- valueOf() : float
- Returns the milliseconds timestamps used amongst other by Date javascript objects.
Methods
createFromTimestamp()
Create a Carbon instance from a timestamp.
public
static createFromTimestamp(int $timestamp[, DateTimeZone|string|null $tz = null ]) : static
Parameters
- $timestamp : int
- $tz : DateTimeZone|string|null = null
Return values
static —createFromTimestampMs()
Create a Carbon instance from a timestamp in milliseconds.
public
static createFromTimestampMs(float $timestamp[, DateTimeZone|string|null $tz = null ]) : static
Parameters
- $timestamp : float
- $tz : DateTimeZone|string|null = null
Return values
static —createFromTimestampUTC()
Create a Carbon instance from an UTC timestamp.
public
static createFromTimestampUTC(int $timestamp) : static
Parameters
- $timestamp : int
Return values
static —getPreciseTimestamp()
Returns a timestamp rounded with the given precision (6 by default).
public
getPreciseTimestamp([int $precision = 6 ]) : float
Parameters
- $precision : int = 6
Tags
Return values
float —timestamp()
Set the instance's timestamp.
public
timestamp(int $value) : static
Parameters
- $value : int
Return values
static —unix()
public
unix() : int
Tags
Return values
int —valueOf()
Returns the milliseconds timestamps used amongst other by Date javascript objects.
public
valueOf() : float