import datetime, json x = {\'alpha\': {datetime.date.today(): \'abcde\'}} print json.dumps(x)
The above code fails with a TypeError since
TypeError
you can do x = {'alpha': {datetime.date.today().strftime('%d-%m-%Y'): 'abcde'}}
x = {'alpha': {datetime.date.today().strftime('%d-%m-%Y'): 'abcde'}}