java timestamp and PHP timestamp

巴扎黑
Release: 2016-11-24 14:02:24
Original
1485 people have browsed it

Due to different precisions, the lengths are inconsistent and direct conversion errors occur.戳Java timestamp length is 13 digits, such as: 1294890876859
Php timestamp length is 10 bits, such as: 1294890859

Php

echo date ('y-m-d h: s', '1294890876'); PHP timestamp is used in JAVA, add three digits at the end and supplement it with 000, such as: 1294890859->1294890859000

java code

Java code

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH: mm:ss");

String dateTime = df.format(1294890859000L);

System.out.println(df);

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!