php - How to convert string into timezone aware date

one text

Solution:

I would try something like

<?php
$date = new DateTime('2020-08-19 13:04:53', new DateTimeZone('Australia/Sydney'));
echo $date->format('Y-m-d H:i:s');
// Output: 2020-08-19 13:04:53

$date->setTimezone(new DateTimeZone('America/New_York'));
echo $date->format('Y-m-d H:i:s');
// Output: 2020-08-18 23:04:53

Source