TimeZone.php in Drupal 10
File
core/modules/system/src/Plugin/migrate/process/d6/TimeZone.php
View source
<?php
namespace Drupal\system\Plugin\migrate\process\d6;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
class TimeZone extends ProcessPluginBase {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$offset = $value;
$timezone_name = timezone_name_from_abbr('', intval($offset), 0);
if (!$timezone_name) {
$timezone_name = 'UTC';
}
return $timezone_name;
}
}
Classes
Name |
Description |
TimeZone |
Process the D6 Timezone offset into a D8 compatible timezone name. |