【问题标题】:human to UNIX time conversion with PHP使用 PHP 将人类时间转换为 UNIX 时间
【发布时间】:2012-06-05 17:06:33
【问题描述】:

我有这样的字符串:Thu, 27 May 2010 07:00:00 GMT

我想将它们转换为 UNIX 时间戳

有什么办法吗?

【问题讨论】:

  • 拜托,拜托,在发布这样的问题之前,请尝试 PHP 手册和 Google ...

标签: php unix date time


【解决方案1】:
echo strtotime('Thu, 27 May 2010 07:00:00 GMT');

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

【讨论】:

    【解决方案2】:

    是的,有办法!事实上,有不止一种方法可以做到! ;)

    你可以使用 strtotime();

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

    http://fr2.php.net/manual/fr/function.strtotime.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-29
      • 2017-04-06
      • 1970-01-01
      • 2013-01-13
      • 2011-10-01
      • 2013-06-01
      • 1970-01-01
      • 2012-10-14
      相关资源
      最近更新 更多