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

Public Member Functions

 __construct (string|integer $date)
 
 __toString ()
 

Detailed Description

Class for create an object of the date type

Constructor & Destructor Documentation

SequoiaDate::__construct ( string|integer  $date)

Constructor.

Parameters
$datethe date
string format
date format.
@code
$dateObj = new SequoiaDate( '2000-01-01' ) ;
$arr = array( 'date' => $dateObj ) ; // json ==> { "date": { "$date": "2000-01-01" } }

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

$dateObj = new SequoiaDate() ;
$arr = array( 'date' => $dateObj ) ; // json ==> { "date": { "$date": "2017-12-01" } }

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

$dateObj = new SequoiaDate( '946656000000' ) ;
$arr = array( 'date' => $dateObj ) ; // json ==> { "date": { "$date": "2000-01-01" } }

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

$dateObj = new SequoiaDate( 946656000000 ) ;
$arr = array( 'date' => $dateObj ) ; // json ==> { "date": { "$date": "2000-01-01" } }

Member Function Documentation

SequoiaDate::__toString ( )

PHP Magic Methods, the class as string output.

Returns
date string
$dateObj = new SequoiaDate( '2000-01-01' ) ;
echo $dateObj ; // output ==> 2000-01-01

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