Skip to content

Instantly share code, notes, and snippets.

@CptKirklnd
Created March 19, 2015 01:08
Show Gist options
  • Save CptKirklnd/28192fc5664be46d2225 to your computer and use it in GitHub Desktop.
Save CptKirklnd/28192fc5664be46d2225 to your computer and use it in GitHub Desktop.
TES Date Converter
import datetime
def tesTime(startYear, realStartYear, era):
#converts the current date to Tamrielic date and time
#originally written in JS for a blog so the year updates based on the in-universse
#year you want to use and it's real world "equivalent"
#these, and the era you want are fed in as arguments
t = datetime.datetime.now()
#dict for each of the Tamerielic months
months = ["Morning Star", "Sun's Dawn", "First Seed", "Midyear", "Sun's Height",
"Last Seed", "Hearthfire", "Frostfall", "Sun's Dusk", "Evening Star"]
days = ["Sundas", "Morndas", "Tirdas", "Middas", "Turdas", "Fredas", "Loredas"]
#here are some rad default values for a setting set in Skyrim's time
#startYear = 201
#realStartYear = 2011
#era = "4"
currentMonth = months[t.month - 1] #the current month in Tamrielic time
currentYear = (t.year - realStartYear) + startYear
currentWeekday = days[t.weekday() - 1]
tesDateString = ""+currentWeekday+", "+str(t.day)+" of "+currentMonth+" "+era+"e"+str(currentYear)
return tesDateString
print tesTime(201, 2011, "4")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment