Skip to content

Instantly share code, notes, and snippets.

@Jordach
Last active January 29, 2017 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jordach/1bf48e164340b294ca0b70fe3ce682ee to your computer and use it in GitHub Desktop.
Save Jordach/1bf48e164340b294ca0b70fe3ce682ee to your computer and use it in GitHub Desktop.
local totaldays = minetest.get_day_count()
local totalmonths = 1
local totalyears = years
repeat
totaldays = totaldays - 30
totalmonths = totalmonths + 1
if totalmonths == 13 then
totalyears = totalyears + 1
totalmonths = 1
end
until totaldays <= 29
days = totaldays
months = totalmonths
years = totalyears
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment