A tick is Minecraft's fundamental unit of time. The game engine processes every event — mob movement, redstone circuits, block updates — exactly once per tick. Under normal conditions the server runs at 20 ticks per second (TPS).
Inspired by the Unix epoch (seconds since January 1, 1970), this library anchors its own epoch at May 16, 2009 — the release date of Minecraft Classic. Every real-world moment can therefore be expressed as a unique tick offset from that date.
Because Minecraft has no native concept of months or years, elapsed time is expressed using only days, hours, minutes, and seconds:
Days 14, 12:32:11
TICK CONVERSION
Since 1 tick = 50 ms of real time, every larger unit is a fixed multiple:
20 ticks=1 second(20 × 1)
1,200 ticks=1 minute(20 × 60)
72,000 ticks=1 hour(20 × 3,600)
1,728,000 ticks=1 day(20 × 86,400)
To break a tick count into human time: divide by 1,728,000 for days → remainder by 72,000 for hours → remainder by 1,200 for minutes → remainder by 20 for seconds.
HOW TO USE
Install the package:
npminstall@jondotsoy/date-minecraft
Import and use:
import{DateMinecraft}from"@jondotsoy/date-minecraft";// From a tick numberconsta=newDateMinecraft(6000);console.log(a.hour);// 12console.log(a.minute);// 0console.log(a.toLocaleString());// "Day 0, 12:00:00"// From a time stringconstb=newDateMinecraft("18:00");console.log(b.tick);// 18000// Ticks since Minecraft's launch (May 16, 2009)constticks=DateMinecraft.now();constcurrent=newDateMinecraft(ticks);// Get ticks per day constantconsole.log(DateMinecraft.TICKS_PER_DAY);// 24000