![]() |
|
12 Clock? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: General Topics (https://hackforums.net/forumdisplay.php?fid=7) +--- Forum: Entertainment (https://hackforums.net/forumdisplay.php?fid=446) +---- Forum: Gaming (https://hackforums.net/forumdisplay.php?fid=65) +---- Thread: 12 Clock? (/showthread.php?tid=4091732) |
12 Clock? - iMirXa™ - Mar 2, 2014 So I'm trying to make a 12 hour clock for my info window and the closest thing I got so far is: Code mc.theWorld.getWorldTime()Which that just gives me how many nanoseconds or milliseconds have passed in the world like "11947" and I have no idea how to convert that into something like "09:22AM". Anyone got any hints or know where to look? * - SIM-1576816 - Mar 2, 2014 Java has class called Data, used like "Data date = new Date();" And then you can draw a string with date.get... * - rogе - Mar 2, 2014 What does this have to do with griefing? This is more of a Java or just Minecraft related thing. * - Jordin - Mar 2, 2014 I think OP is wanting the time in mine craft, not the time in real life. * - Spectro_Shifter - Mar 2, 2014 The time in world is different to the time in real life, I believe. Use this for the date: new Date() Edit: if you want time in game I think you should divide the ticks by 20 to get the amount of time in seconds. The time is in ticks, I think, not in milliseconds nor nanoseconds. * - iMirXa™ - Mar 3, 2014 So I figured it out, not sure if anybody wants it but its here if they do, it has three formats (First one is best) but are all basically "HH:MM:AM/PM". Variables "hour24" and "minute" are from this thread on minecraftforums.net. Code public String getTime(long time){Code getTime(mc.theWorld.getWorldTime); |