Skip to content

Commit 1830a99

Browse files
authored
Merge pull request #60 from BeLimitLess/patch-1
Updated month and day telling feature with strftime() function
2 parents 4d92623 + f4d5530 commit 1830a99

File tree

1 file changed

+5
-45
lines changed

1 file changed

+5
-45
lines changed

PA.py

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -418,55 +418,15 @@ def country_cases():
418418

419419
elif 'month' in query or 'month is going' in query:
420420
def tell_month():
421-
localtime = time.asctime(time.localtime(time.time()))
422-
m_onth = localtime[4:7]
423-
if m_onth == "Jan":
424-
fun_talk("it's january")
425-
if m_onth == "Feb":
426-
fun_talk("it's february")
427-
if m_onth == "Mar":
428-
fun_talk("it's march")
429-
if m_onth == "Apr":
430-
fun_talk("it's april")
431-
if m_onth == "May":
432-
fun_talk("it's may")
433-
if m_onth == "Jun":
434-
fun_talk("it's june")
435-
if m_onth == "Jul":
436-
fun_talk("it's july")
437-
if m_onth == "Aug":
438-
fun_talk("it's august")
439-
if m_onth == "Sep":
440-
fun_talk("it's september")
441-
if m_onth == "Oct":
442-
fun_talk("it's october")
443-
if m_onth == "Nov":
444-
fun_talk("it's november")
445-
if m_onth == "Dec":
446-
fun_talk("it's december")
447-
421+
month = datetime.datetime.now().strftime("%B")
422+
fun_talk(month)
448423

449424
tell_month()
450425

451426
elif 'day' in query or 'day today' in query:
452427
def tell_day():
453-
localtime = time.asctime(time.localtime(time.time()))
454-
day = localtime[0:3]
455-
if day == "Sun":
456-
fun_talk("it's sunday")
457-
if day == "Mon":
458-
fun_talk("it's monday")
459-
if day == "Tue":
460-
fun_talk("it's tuesday")
461-
if day == "Wed":
462-
fun_talk("it's wednesday")
463-
if day == "Thu":
464-
fun_talk("it's thursday")
465-
if day == "Fri":
466-
fun_talk("it's friday")
467-
if day == "Sat":
468-
fun_talk("it's saturday")
469-
428+
day = datetime.datetime.now().strftime("%A")
429+
fun_talk(day)
470430

471431
tell_day()
472432

@@ -699,4 +659,4 @@ def send_whtmsg():
699659
fun_talk("Starting the game!")
700660
snake_game.game()
701661
except Exception as e:
702-
pass
662+
pass

0 commit comments

Comments
 (0)