


Simple implementation of PHP timestamp and specific time conversion, PHP specific time conversion
A simple implementation of PHP timestamp and specific time conversion, PHP specific time conversion
Three built-in functions:
time() //获取UNIX系统时间戳 mktime(hour,minute,second,month,day,year) //将指定时间转化为时间戳 date(时间格式,时间戳) //将时间戳转化为方便阅读的时间
time -> date:
$now = time(); echo "时间戳是 " .$now; echo "创建日期是 " . date("Y-m-d h:i:s", $now); 输出: 时间戳是 1404610907 创建日期是 2014-07-06 09:41:47
mktime -> date:
$d=mktime(9, 41, 47, 7, 6, 2014); echo "时间戳是 " .$d; echo "创建日期是 " . date("Y-m-d h:i:s", $d); 输出: 时间戳是 1404610907 创建日期是 2014-07-06 09:41:47
Note:
Generally, when registering or logging in, the time function is used by default to obtain the current timestamp. When there is a business that needs to specify a specific time, the mktime function can be used to convert it into a specific timestamp according to the specific time, and the date function can be used to convert the timestamp. The reverse is converted into a specific time for easy viewing.
The above simple implementation of PHP timestamp and specific time conversion is all the content shared by the editor. I hope it can give you a reference, and I also hope that everyone will support Bangkejia.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
