Do you know how I can convert this to a strtotime, or a similar type of value to pass into the DateTime object?
The date I have:
Mon, 1
it is my solution:
function changeDateTimezone($date, $from='UTC', $to='Asia/Tehran', $targetFormat="Y-m-d H:i:s") { $date = new DateTime($date, new DateTimeZone($from)); $date->setTimeZone(new DateTimeZone($to)); return $date->format($targetFormat); }