<?php

namespace Easymailing\App\Utils;

class DateUtils
{

	public static function formatDateWithTimezone(string $dateISO): string
	{
		$wpTimezone = new \DateTimeZone(get_option('timezone_string') ?: 'UTC');
		$lastFinishedAtObj = new \DateTime($dateISO, new \DateTimeZone('UTC'));
		$lastFinishedAtObj->setTimezone($wpTimezone);
		return $lastFinishedAtObj->format('Y-m-d H:i:s');
	}

}
