Continue removing the time module.

Convert some more struct_time instances to datetime objects.
This commit is contained in:
John "Elwin" Edwards 2012-07-26 10:14:56 -07:00
parent 72fcde0ae0
commit 4771dce2d0
2 changed files with 8 additions and 8 deletions

View file

@ -55,11 +55,14 @@ def input_datetime(outf, dvals=[None, None, None, None, None, None]):
emptf = '<input type="text" size="2" maxlength="2" name="{0}">'
sstr = '<div>Date: <select name="year">\n'
# Default to today
now = time.gmtime()
for dindex in range(3):
if not dvals[dindex]:
dvals[dindex] = now[dindex]
for year in range(2010, now[0] + 1):
now = datetime.now(rlgall.utc)
if dvals[0] != None:
dvals[0] = now.year
if dvals[1] != None:
dvals[1] = now.month
if dvals[2] != None:
dvals[2] = now.day
for year in range(2010, now.year + 1):
if year == dvals[0]:
sstr += soptstr.format(year, year)
else:
@ -279,8 +282,6 @@ if not isnotsearch:
dosearch = formname != None and dungeon != None and searchtime != None
# Find the actual files, and put them in a list called gamefiles.
gtimes = [0, int(time.time())]
relgame = None
gamefiles = []
if dosearch:
query1 = "SELECT ttyrecs FROM {0} WHERE name = %s AND startt <= %s AND endt >= %s;".format(dungeon.uname)