Home > Backend Development > PHP Problem > How to convert php timestamp to java

How to convert php timestamp to java

PHPz
Release: 2023-03-05 22:14:02
Original
2705 people have browsed it

How to convert php timestamp to java: First create a script sample file; then use the "javaTimeStamp=phpTimeStamp*1000" method to convert php timestamp to java timestamp.

How to convert php timestamp to java

Recommended: "PHP Video Tutorial"

java timestamp and php timestamp conversion

java timestamp is 13 digits, for example: javaTimeStamp=1475309160000

java ->php, divide by 1000, you will get 10 digits php timestamp

phpTimeStamp=javaTimeStamp/1000
Copy after login

php timestamp is 10 digits, for example :phpTimeStamp=1475309160

php -> java, multiply by 1000, you will get the 13-digit java timestamp

javaTimeStamp=phpTimeStamp*1000
Copy after login

The above is the detailed content of How to convert php timestamp to java. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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