magento 2 - getCreatedAt() returns UTC time and not local time
You can use an instance of Timezone to convert it into store's timezone. Here is a very generic example.
namespace VendorName\ModuleName\MyDir;
class MyClass
{
private $timezone;
public function __construct(
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
) {
$this->timezone = $timezone;
}
public function myMethod($order)
{
$created = $order->getCreatedAt();
//Convert to store timezone
$created = $this->timezone->date(new \DateTime($created));
//To print or display this you can use following.
//Feel free to tweak the format
$dateAsString = $created->format('M j, Y g:i:s A');
//Proceed further..
}
}