PHP Time Problem, Need Help Fast

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barryoneill81
    New Member
    • Mar 2007
    • 1

    PHP Time Problem, Need Help Fast

    Hi Guys,
    I have this problem and it is driving me crazy. I am a java programmer but also use php. my problem is that I am trying to store a timestamp in milliseconds using php to a mysql database. This stamp is then read by a java mobile application and changed to a date. The problem is that java timestamps are in milliseconds and php uses seconds. its not as easy as multiplying by 1000 due to the rounding that goes on in the background. If any of you could let me know how to generate a timestamp in milliseconds in php I would very much appreciate it.
    Thanks in advance.
    Barry.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    You can use the microtime() function.
    Works like the time() function but with milliseconds

    More info at www.php.net

    Comment

    Working...