static function PersianDateFactory::buildFromOriginalDateTime in Persian Date for Drupal 8 8
Same name and namespace in other branches
- 8.4 src/Converter/PersianDateFactory.php \Drupal\persian_date\Converter\PersianDateFactory::buildFromOriginalDateTime()
Bulid PersianDateTime instance from original PHP DateTime object.
Parameters
\DateTime $dateTime:
Return value
1 call to PersianDateFactory::buildFromOriginalDateTime()
- PersianDrupalDateTime::format in src/
Plugin/ Datetime/ PersianDrupalDateTime.php - Overrides format().
File
- src/
Converter/ PersianDateFactory.php, line 54
Class
- PersianDateFactory
- This class is responsible to build Persian DateTime instances.
Namespace
Drupal\persian_date\ConverterCode
static function buildFromOriginalDateTime(\DateTime $dateTime) {
$object = new PersianDate();
$object
->setTimezone($dateTime
->getTimezone());
$object
->setTimestamp($dateTime
->getTimestamp());
return $object;
}