Advertisement
Kalidor_Vorlich

Game Time

Jul 15th, 2018
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.01 KB | None | 0 0
  1. import time
  2.  
  3. #Earth Time
  4. seconds = int(time.time()) #seconds since epoch(1200am, Jan 01 1970)
  5. mins = int (seconds / 60)
  6. hours = int (mins/ 60)
  7. days = int (hours / 24)
  8. years = int (days / 365)
  9.  
  10. print("Seconds:",seconds)
  11. print("Mins:",mins)
  12. print("Hours:",hours)
  13. print("Days:",days)
  14. print("Years:",years)
  15.  
  16. #Game Time
  17. gseconds = int(seconds * 25)
  18. mincount = int (gseconds / 60)
  19. hourcount = int(mincount / 60)
  20. daycount = int (hourcount / 24)
  21. monthcount = int (daycount / 30)  #simplified 30 day month
  22. yearcount = int(monthcount /12)
  23. weekcount = int (daycount / 8) #8 day week
  24.  
  25. print("DayCount: ",daycount)
  26. print("MonthCount: ",monthcount)
  27. print("YearCount: ",yearcount)
  28. print("WeekCount: ",weekcount)
  29.  
  30. ### -- CALC HOUR -- ###
  31. hour = hourcount%(24)
  32. print(hour)
  33.  
  34.  
  35. ### -- CALC MIN -- ###
  36. min = mincount%(60)
  37. print(min)
  38.  
  39. ### -- CALC DAY -- ###
  40. day = None
  41. dayremainder = daycount%(8)
  42. if dayremainder == 0:
  43.     print("Monday")
  44.     day = "Monday"
  45. elif dayremainder == 1:
  46.     print("Tuesday")
  47.     day = "Tuesday"
  48. elif dayremainder == 2:
  49.     print("Wednesday")
  50.     day = "Wednesday"
  51. elif dayremainder == 3:
  52.     print("Thursday")
  53.     day = "Thursday"
  54. elif dayremainder == 4:
  55.     print("Friday")
  56.     day = "Friday"
  57. elif dayremainder == 5:
  58.     print("Saturday")
  59.     day = "Saturday"
  60. elif dayremainder == 6:
  61.     print("Sunday")
  62.     day = "Sunday"
  63. elif dayremainder == 7:
  64.     print("Newday")
  65.     day = "Newday"
  66. else:
  67.     print("Default")
  68.     print(dayremainder)
  69.  
  70.  
  71. ### -- CALC MONTH -- ##
  72. month = None
  73. monthremainder = monthcount%(12)
  74. if monthremainder == 0:
  75.     print("January")
  76.     month = "January"
  77. elif monthremainder == 1:
  78.     print("February")
  79.     month = "February"
  80. elif monthremainder == 2:
  81.     print("March")
  82.     month = "January"
  83. elif monthremainder == 3:
  84.     print("April")
  85.     month = "April"
  86. elif monthremainder == 4:
  87.     print("May")
  88.     month = "May"
  89. elif monthremainder == 5:
  90.     print("June")
  91.     month = "June"
  92. elif monthremainder == 6:
  93.     print("July")
  94.     month = "July"
  95. elif monthremainder == 7:
  96.     print("August")
  97.     month = "August"
  98. elif monthremainder == 8:
  99.     print("September")
  100.     month = "September"
  101. elif monthremainder == 9:
  102.     print("October")
  103.     month = "October"
  104. elif monthremainder == 10:
  105.     print("November")
  106.     month = "November"
  107. elif monthremainder == 11:
  108.     print("December")
  109.     month = "December"
  110. else:
  111.     print("Default")
  112.     print(monthremainder)
  113.  
  114. season = None
  115. ### -- CALC SEASON -- ###
  116. if monthremainder >=11 and monthremainder <=2:
  117.     print("Winter")
  118.     season = "Winter"
  119. elif monthremainder >=3 and monthremainder <=5:
  120.     print("Spring")
  121.     season = "Spring"
  122. elif monthremainder >=7 and monthremainder <=8:
  123.     print("Summer")
  124.     season = "Summer"
  125. elif monthremainder >=9 and monthremainder <=10:
  126.     print("Autumn")
  127.     season = "Autumn"
  128. else:
  129.     print("Default")
  130.     print(monthremainder)
  131.  
  132.  
  133. print(day, " - ",dayremainder, " - " ,month, " - ", yearcount, " in the ", season, " time.", " It's: ",hour, ":",min)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement