Server time

Discussion in 'Spigot Plugin Development' started by HotProtato, Jul 4, 2015.

  1. I am creating a plugin that checks the amount of times users has logged in for in a row which will update based on the server time. The only problem is if there were restarts and such the server time can go out of place so I want to know what the most efficient way would be for me to get the real server time?

    What I was thinking is get the time from a database that always keeps on going.
  2. System.currentTimeMillis()

    Most accurate one you can have (Except nano ofcourse xd)
    • Like Like x 1
  3. Thanks :)
  4. sothatsit


    Actually, Nano time should only be used for comparing 2 times on my the same machine. If they were to ever change where they are hosted the nano time would be off.