Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace time
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Earth Time
- TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
- int secondsSinceEpoch = (int)t.TotalSeconds;
- Console.WriteLine(secondsSinceEpoch + " SecondsSinceEpoch");
- //Game Time
- int gseconds = secondsSinceEpoch * 25;
- int mincount = gseconds / 60;
- int hourcount = mincount / 60;
- int daycount = hourcount / 24;
- int monthcount = daycount / 30; //simplified 30 day month
- int yearcount = monthcount / 12;
- int weekcount = daycount / 8; //8 day week
- Console.WriteLine(gseconds + " GSecondCount");
- Console.WriteLine(mincount + " MinCount");
- Console.WriteLine(hourcount + " HourCount");
- Console.WriteLine(daycount + " DayCount");
- Console.WriteLine(monthcount + " MonthCount");
- Console.WriteLine(yearcount + " YearCount");
- Console.WriteLine(weekcount + " Weekcount");
- //### -- CALC HOUR -- ###
- int hour = hourcount % (24);
- //### -- CALC MIN -- ###
- int minute = mincount % (60);
- Console.WriteLine(hour + "Hour");
- Console.WriteLine(minute + "Minute");
- //### -- CALC DAY -- ###
- string day = "";
- int dayremainder = daycount % (8);
- if (dayremainder == 0)
- {
- day = "Firesday";
- }
- else if (dayremainder == 1)
- {
- day = "Earthsday";
- }
- else if (dayremainder == 2)
- {
- day = "Watersday";
- }
- else if (dayremainder == 3)
- {
- day = "Windsday";
- }
- else if (dayremainder == 4)
- {
- day = "Iceday";
- }
- else if (dayremainder == 5)
- {
- day = "Lightningday";
- }
- else if (dayremainder == 6)
- {
- day = "Lightsday";
- }
- else if (dayremainder == 7)
- {
- day = "Darksday";
- }
- else
- {
- Console.WriteLine("DefaultDay");
- Console.WriteLine(dayremainder);
- }
- System.Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement