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 {
20 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
22 // Convert the integer value of the offset (which can be either
23 // negative or positive) to a timezone name.
24 // Note: Daylight saving time is not to be used.
25 $timezone_name = timezone_name_from_abbr('', intval($offset), 0);
26 if (!$timezone_name) {
27 $timezone_name = 'UTC';
30 return $timezone_name;