-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatetoday.py
59 lines (56 loc) · 1.06 KB
/
datetoday.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import datetime
import calendar
def today_date():
now = datetime.datetime.now()
date_now = datetime.datetime.today()
week_now = calendar.day_name[date_now.weekday()]
month_now = now.month
day_now = now.day
months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
]
ordinals = [
"1st",
"2nd",
"3rd",
"4th",
"5th",
"6th",
"7th",
"8th",
"9th",
"10th",
"11th",
"12th",
"13th",
"14th",
"15th",
"16th",
"17th",
"18th",
"19th",
"20th",
"21st",
"22nd",
"23rd",
"24th",
"25th",
"26th",
"27th",
"28th",
"29th",
"30th",
"31st",
]
return ("Today is " + week_now + ", " + months[month_now - 1] + " the " + ordinals[day_now - 1] + ".")