Impact::castToDateTimeGmt

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Impact
  4. castToDateTimeGmt
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/processor/task/scheduler/result/impact.php
  • Класс: BitrixTasksProcessorTaskSchedulerResultImpact
  • Вызов: Impact::castToDateTimeGmt
static function castToDateTimeGmt($date)
{
	if($date == null)
	{
		return null;
	}

	if(is_string($date))
	{
		// $date is treated as LOCAL TIME, since we have no information about time zone
		return DateTime::createFromUserTimeGmt($date);
	}
	elseif ($date instanceof BitrixMainTypeDateTime)
	{
		// to local time ...
		$date = $date->toString();

		// .. and return as gmt
		return DateTime::createFromUserTimeGmt($date);
	}
	else
	{
		return null;
	}
}

Добавить комментарий