Skip to content

Instantly share code, notes, and snippets.

@ruliarmando
Created December 11, 2013 15:00
Show Gist options
  • Save ruliarmando/7911838 to your computer and use it in GitHub Desktop.
Save ruliarmando/7911838 to your computer and use it in GitHub Desktop.
import datetime
month_placeholder = {
'Jan' : 1,
'Feb' : 2,
'Mar' : 3,
'Apr' : 4,
'Mei' : 5,
'Jun' : 6,
'Jul' : 7,
'Agu' : 8,
'Sep' : 9,
'Okt' : 10,
'Nov' : 11,
'Des' : 12,
}
def parse_indo_date(d):
s_date = d.split()
day = int(s_date[0])
month = month_placeholder[s_date[1]]
year = int(s_date[2])
return datetime.date(year, month, day)
indo_date = {}
for i in range(3):
i = raw_input('enter date-%d: ' % i)
indo_date[parse_indo_date(i)] = i
for d in sorted(indo_date.keys()):
print indo_date[d]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment