Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

php(unix) timestamp to java.sql.Timestamp

 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic