Skip to content

cDateTime::__construct()

Rainer Stötter edited this page Apr 28, 2017 · 15 revisions

Method __construct( )

 public   \libdatephp\cDateTime libdatephp\cDateTime::__construct(mixed $p1, integer $p2, integer $p3, integer $p4, integer $p5, integer $p6)

constructor for the cDateTime class

$dtm = new cDateTime( 11, 22, 2016, 5, 0, 0 ); from month, day, year, hours, minutes, seconds

$dtm = new cDateTime( '11-22-2016 5:0:0' ); from string

$dtm = new cDateTime( new cDate( 11, 22, 2016 ) ); from cDate

$dtm = new cDateTime( 20516 ); from a timestamp.

Arguments

  • $p1 mixed - <p>can be an int as year or a timestamp, a cDateTime or a cDate or a string</p>
  • $p2 integer - <p>the day or 0</p>
  • $p3 integer - <p>the year or 0</p>
  • $p4 integer - <p>the hour or 0</p>
  • $p5 integer - <p>the minute or 0</p>
  • $p6 integer - <p>the second or 0</p>

Returns

\libdatephp\cDateTime 

Clone this wiki locally