3 namespace Drupal\system\Plugin\migrate\process\d6;
5 use Drupal\migrate\MigrateExecutableInterface;
6 use Drupal\migrate\ProcessPluginBase;
7 use Drupal\migrate\Row;
10 * Process the D6 Timezone offset into a D8 compatible timezone name.
12 * @MigrateProcessPlugin(
16 class TimeZone extends ProcessPluginBase {
21 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
23 // Convert the integer value of the offset (which can be either
24 // negative or positive) to a timezone name.
25 // Note: Daylight saving time is not to be used.
26 $timezone_name = timezone_name_from_abbr('', intval($offset), 0);
27 if (!$timezone_name) {
28 $timezone_name = 'UTC';
31 return $timezone_name;