PHP common library functions, php library functions_PHP tutorial

WBOY
Release: 2016-07-12 09:05:12
Original
756 people have browsed it

PHP common library functions, php library functions

1. Time and date
  • How to get the timestamp time()--the number of milliseconds since 1970
echo time();
Copy after login
  • Date
echo date(<span>'</span><span>Y-m-d H:i:s</span><span>'</span>);
Copy after login
  • The default time zone is obtained
echo date_default_timezone_get();
Copy after login
  • The time obtained by default is inconsistent with the local computer time, and the corresponding time zone needs to be set
date_default_timezone_set('Asia/Shanghai'); //设置为上海的时区
echo date(<span>'</span><span>Y-m-d H:i:s</span><span>'</span>);
Copy after login
  • Convert timestamp to date and present it
echo date(<span>'</span><span>Y-m-d H:i:s</span><span>'</span><span>,time());
echo </span><span>'</span><span><br/></span><span>'</span><span>;
echo date(</span><span>'</span><span>Y-m-d H:i:s</span><span>'</span>,time());
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1070037.htmlTechArticlePHP common library functions, php library functions 1. How to get the timestamp time()--from 1970 The number of milliseconds calculated from the beginning of the year echo time(); Date echo date( ' Y-m-d H:i:s ' ); The default value is...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!