SequoiaDB
 All Classes Files Functions Variables Pages
Public Member Functions | List of all members
SequoiaTimestamp Class Reference

Public Member Functions

 __construct (string|integer $timestamp)
 
 __toString ()
 

Detailed Description

Class for create an object of the timestamp type

Constructor & Destructor Documentation

SequoiaTimestamp::__construct ( string|integer  $timestamp)

Constructor.

Parameters
$timestampis timestamp string

timestamp format

$timeObj = new SequoiaTimestamp( '2000-01-01-12.30.20.123456' ) ;
$arr = array( 'time' => $timeObj ) ; // json ==> { "time": { "$timestamp": "2000-01-01-12.30.20.123456" } }

default parameter, current timestamp. ( Available/Support on 2.10 or newer version. )

$timeObj = new SequoiaTimestamp() ;
$arr = array( 'time' => $timeObj ) ; // json ==> { "time": { "$timestamp": "2017-12-01-10.20.13.000000" } }

string format(millisecond). ( Available/Support on 2.10 or newer version. )

$timeObj = new SequoiaTimestamp( '946656000' ) ;
$arr = array( 'time' => $timeObj ) ; // json ==> { "time": { "$timestamp": "2000-01-01-00.00.00.000000" } }

integer(millisecond). ( Available/Support on 2.10 or newer version. )

$timeObj = new SequoiaTimestamp( 946656000 ) ;
$arr = array( 'time' => $timeObj ) ; // json ==> { "time": { "$timestamp": "2000-01-01-00.00.00.000000" } }

integer(millisecond) and integer(increase). ( Available/Support on 3.0.1 or newer version. )

$timeObj = new SequoiaTimestamp( 946656000, 1234 ) ;
$arr = array( 'time' => $timeObj ) ; // json ==> { "time": { "$timestamp": "2000-01-01-00.00.00.001234" } }

Member Function Documentation

SequoiaTimestamp::__toString ( )

PHP Magic Methods, the class as string output.

Returns
timestamp string
$timeObj = new SequoiaTimestamp( '2000-01-01-12.30.20.123456' ) ;
echo $timeObj ; // output ==> 2000-01-01-12.30.20.123456

The documentation for this class was generated from the following file: