Converting Raw Time Into Something Real

Discussion in 'Plugin Development' started by lego6245, Feb 23, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    lego6245

    So, I know that when server time is 0, it is sunrise. But what time is sundown? Midnight? Midday? All of these questions are critical, and yet I can find no good explanation.

    Any help would be great :3
     
  2. Offline

    Edward Hand

    Here's a formula:
    Code:
    Date time = new Date(3600*((theServerTime+6000)%24000));
    String formattedTime = DateFormat.getTimeInstance(DateFormat.SHORT).format(time)
    --- merged: Feb 24, 2011 12:13 AM ---
    To explain a little, there are 24,000 ticks in a minecraftian day. Dawn is around 0. Midday is 6,000. Sunset at around 12,000. Midnight at 18,000. Back to dawn at 24,000
     
  3. Offline

    lego6245

    Much thanks. That's just what I needed.
     
Thread Status:
Not open for further replies.

Share This Page