wood burning stoves 2.0
The moose likes Linux / UNIX and the fly likes php(unix) timestamp to java.sql.Timestamp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "php(unix) timestamp to java.sql.Timestamp" Watch "php(unix) timestamp to java.sql.Timestamp" New topic

php(unix) timestamp to java.sql.Timestamp

vu lee
Ranch Hand

Joined: Apr 19, 2005
Posts: 195
php time() returns current unix timestamp containing 10 digits which is not equivalent with java.sql.Timestamp containing 13 digits. To temporarily resolve the issue, I multiply unix timestamp by 1000.

What is the proper way to map unix timestamp to java timestamp?
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

And unix-timestamp=php.timestamp or unix-timestamp=sql.Timestamp?

However - if your conversion is correct - do you guess there is a more accurate or faster solution than a multiplication by 1000?

I agree. Here's the link: http://aspose.com/file-tools
subject: php(unix) timestamp to java.sql.Timestamp
It's not a secret anymore!