I have the following code:
fixtures = StraightredFixture.objects.filter(soccerseason=soccerseason,fixturematchday=fixturematchday).order_by('fixturedate')
firstGameTime = str(fixtures[0].fixturedate).split()
currentTime = str(datetime.now().strftime("%Y-%m-%d %H:%M:%S")).split()
if firstGameTime >= currentTime:
selectteams = True
else:
selectteams = False
Whatever the date of the firstGameTime is it always returns False. Two examples are as follows:
firstGameTime = ['2010-10-28', '11:30:00+00:00']
currentTime = ['2016-10-29', '10:51:50']
selectteams = False
firstGameTime = ['2010-10-30', '11:30:00+00:00']
currentTime = ['2016-10-29', '10:53:16']
selectteams = False
In the second example I would expect it to say True as the firstGameTime is the 30th whereas the currentTime is the 29th.
I have a feeling it is to do with the +00:00 part but am at a loss on how to fix this. Any help would be appreciated, many thanks, Alan.