Skip to content

Commit

Permalink
Merge pull request #1378 from MCJack123/patch-15
Browse files Browse the repository at this point in the history
Add more explanation on how `os.epoch("ingame")` works
  • Loading branch information
SquidDev authored Mar 16, 2023
2 parents 2661829 + 06af3c7 commit 1848d91
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,21 @@ public final int day(Optional<String> args) throws LuaException {
/**
* Returns the number of milliseconds since an epoch depending on the locale.
* <p>
* * If called with {@code ingame}, returns the number of milliseconds since the
* * If called with {@code ingame}, returns the number of *in-game* milliseconds since the
* world was created. This is the default.
* * If called with {@code utc}, returns the number of milliseconds since 1
* January 1970 in the UTC timezone.
* * If called with {@code local}, returns the number of milliseconds since 1
* January 1970 in the server's local timezone.
*
* :::info
* The {@code ingame} time zone assumes that one Minecraft day consists of 86,400,000
* milliseconds. Since one in-game day is much faster than a real day (20 minutes), this
* will change quicker than real time - one real second is equal to 72000 in-game
* milliseconds. If you wish to convert this value to real time, divide by 72000; to
* convert to ticks (where a day is 24000 ticks), divide by 3600.
* :::
*
* @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set.
* @return The milliseconds since the epoch depending on the selected locale.
* @throws LuaException If an invalid locale is passed.
Expand Down

0 comments on commit 1848d91

Please sign in to comment.