Skip to content

cDateTime::FromAnyString()

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

Method FromAnyString( )

 public   mixed libdatephp\cDateTime::FromAnyString($str)

FromAnyString( ) sets the timestamp to the value represented by a string. The method decides automatically, which format the user has chosen

Example:

use libdatephp;

$dtm1 = new cDateTime( '22.12.2016 05:00:00' );

$dtm2 = new cDateTime( '12/22/2016 05:00:00' );

$dtm3 = new cDateTime( '2016-12-22 05:00:00' );

Arguments

  • $str mixed

Clone this wiki locally