Skip to content

cDateISO::__construct()

Rainer Stötter edited this page May 17, 2017 · 2 revisions

Method __construct( )

 public   \libdatephp\cDate libdatephp\cDate::__construct(mixed $m, mixed $d, integer $y)

The constructor for the cDate class

Example:

$p = new cDate( 11, 22, 2016 ); from month, day, year

$p = new cDate( '2017-02-28' ); from SQL string

$p = new cDate( '28.02.2017' ); from DMY string

$p = new cDate( '02-28-2017' ); from MDY string

$p = new cDate( ); a date with today's date

$dtm = new cDate( new cDate( 11, 22, 2016 ) ); a copy constructor

$dtm = new cDate( 200516 ); from a timestamp

Arguments

  • $m mixed - <p>can be an int as month or a timestamp or a cDate</p>
  • $d mixed - <p>can be a date or an int as day or a cDate</p>
  • $y integer - <p>the year of the first date</p>

Returns

\libdatephp\cDate 

Clone this wiki locally