Home  >  Article  >  Backend Development  >  PHP time conversion code for Unix timestamp

PHP time conversion code for Unix timestamp

WBOY
WBOYOriginal
2016-07-25 09:05:29883browse
  1. /**
  2. Time Convert Unix Timestamp
  3. link: http://bbs.it-home.org
  4. */
  5. date_default_timezone_set('Asia/Chongqing');
  6. $time1 = "2013-02-16 08:40:54";
  7. $time2 = strtotime ($time1);
  8. echo $time2;
  9. echo date('Y-m-d h:i:s',$time2);
  10. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn