Alireza
Alireza

Reputation: 5673

human to UNIX time conversion with PHP

I have this strings like this: Thu, 27 May 2010 07:00:00 GMT

I want to convert them to UNIX timestamp

Is there any way?

Upvotes: 0

Views: 1106

Answers (2)

torr
torr

Reputation: 1316

Yes, there is a way! In fact, there is more than one way to do it! ;)

You can use strtotime();

$time_en = "Thu, 27 May 2010 07:00:00 GMT"
$time = strtotime($time_en);

https://www.php.net/manual/fr/function.strtotime.php

Upvotes: 1

Sarfraz
Sarfraz

Reputation: 382686

echo strtotime('Thu, 27 May 2010 07:00:00 GMT');

http://php.net/manual/en/function.strtotime.php

Upvotes: 2

Related Questions