-1

I never thought this will be such a pain. What is the best way to convert back this timestamp to a standard PHP timestamp that strtotime() accepts? :

September 29, 2017, 7:16 UTC

The format is:

date("F j, Y, G:i T")

1 Answers1

1

Build a DateTime object first, then format it to a standard format, this will pass into strtotime.

$date = "September 29, 2017, 7:16 UTC";
$day = new DateTime($date);
$utc = strtotime($day->format("Y-m-d g:i A"));
MCMXCII
  • 1,043
  • 4
  • 13
  • 26