Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function daysToDate(days)
- year = math.floor(days/360+2000)
- month = math.floor((days%360)/30+1)
- day = math.floor((days%360)%30+1)
- if month == 1 then month = "Jan"
- elseif month == 2 then month = "Feb"
- elseif month == 3 then month = "Mar"
- elseif month == 4 then month = "Apr"
- elseif month == 5 then month = "May"
- elseif month == 6 then month = "Jun"
- elseif month == 7 then month = "Jul"
- elseif month == 8 then month = "Aug"
- elseif month == 9 then month = "Sep"
- elseif month == 10 then month = "Oct"
- elseif month == 11 then month = "Nov"
- elseif month == 12 then month = "Dec"
- else month = "Month"
- end
- date = {month, day, year}
- return date
- end
- while true do
- m = peripheral.wrap("right")
- m.clear()
- m.setCursorPos(5,1)
- m.setTextScale(2)
- m.write(textutils.formatTime(os.time(), false))
- m.setCursorPos(2,2)
- date = daysToDate(os.day())
- m.write(string.format("%s %s, %s", date[1], date[2], date[3]))
- sleep (1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement