Skip to content

Instantly share code, notes, and snippets.

@kylekatarnls
Last active January 30, 2019 12:58
Show Gist options
  • Save kylekatarnls/380246be4d99a86cfcddecc0097966c5 to your computer and use it in GitHub Desktop.
Save kylekatarnls/380246be4d99a86cfcddecc0097966c5 to your computer and use it in GitHub Desktop.
<?php
$dateString = rtrim($_POST['date'], 'Z');
$date = new DateTimeImmutable("$dateString Asia/Tokyo");
echo $date->setTimezone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s.u');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment