java ---- php time conversion_PHP tutorial

WBOY
Release: 2016-07-14 10:11:03
Original
1016 people have browsed it

Conversion problem between java timestamp and PHP timestamp: JAVA timestamp length is 13 digits, such as: 1294890876859
The length of PHP timestamp is 10 digits, such as: 1294890859. The main difference is the last three digits. JAVA timestamp is used in PHP, and the last three digits are removed, such as: 1294890876859-> 1294890876 Result: 2011-01-13 11:54:36

echo date('Y-m-d H:i:s','1294890876');


PHP timestamp is used in JAVA, add three digits at the end and supplement it with 000, such as: 1294890859->1294890859000

Result: 2011-01-13 11:54:19SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateTime = df.format(1294890859000L);
System.out.println(df);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477400.htmlTechArticleConversion problem between java timestamp and PHP timestamp: JAVA timestamp length is 13 digits, such as: 1294890876859 PHP time The stamp length is 10 digits, such as: 1294890859. The main difference is the last three digits. In JAVA...
Related labels:
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