Skip to content

cDate::FromAnyString()

Rainer Stötter edited this page May 9, 2017 · 14 revisions

Method FromAnyString( )

 public   mixed libdatephp\cDate::FromAnyString(string $str)

The method FromAnyString( ) sets the internal date according to the string $str. It recognizes the input format ( MDY, SQL, DMY ) automatically.

Example:

$dt = new \libdatephp\cDate( 1, 1, 2017 );
for ( $i = 0; $i < 12; $i++ ) {
     echo "\n the month " . $dt->C_Month_Long_EN( ) . ' of the year ' . $dt->Year( ) . ' has ' . $dt->WeeksOfMonth( ) . ' weeks';
     $dt->AddMonths( );
}

Arguments

  • $str string - <p>the string with the date</p>

See also

Clone this wiki locally