createFromUserTime
\Bitrix\Main\Type\DateTime public static \Bitrix\Main\Type\DateTime::createFromUserTime( string $timeString );
Static method creates object of class \DateTime
from local user time with global timezone settings and regional settings by default.
Parameters
Parameter | Description | Version |
---|---|---|
$timeString | Full or abbreviated time format. |
Example
//time from current site format. In case of unavailable time, inserts 00:00:00 \Bitrix\Main\Type\DateTime::createFromUserTime("16.08.2014 15:30:10"); //time from current site format $date = new \Bitrix\Main\Type\DateTime("16.08.2014 15:30:10"); $arFields = Array( 'DATE_START' => \Bitrix\Main\Type\DateTime::createFromUserTime("16.08.2014 15:30:10"); );
© «Bitrix24», 2001-2024