What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-30 16:30:06
python tomorrow
datetime.date.today() + datetime.timedelta(days=1) Add solution -
Python 2021-09-30 05:36:02
python date format
The program below converts a datetime object containing current date and time to different string formats. Code: from datetime import datetime now = datetime.now() # current date and time year = now.strftime("%Y") print("year:", ... Add solution -
Python 2021-09-28 23:13:04
python add one month to a date
import datetime import calendar def add_months(sourcedate, months): month = sourcedate.month - 1 + months year = sourcedate.year + month // 12 month = month % 12 + 1 day = min(sourcedate.day, calendar.monthrange(year,month)[1]) return... Add solution -
Python 2021-09-28 20:56:03
ai virtual assistant
import os import time import webbrowser from datetime import date import playsound import speech_recognition as sr from gtts import gTTS import wikipedia from datetime import datetime WAKE = 'Sam' def speak111(text): tts = gTTS(text=text, lang=&quo... Add solution -
Python 2021-09-28 20:45:05
how to convert 24 hours to 12 hours in python
from datetime import datetime d = datetime.strptime("10:30", "%H:%M") print(d.strftime("%I:%M %p")) # outputs '10:30 AM' d = datetime.strptime("22:30", "%H:%M") print(d.strftime("%I:%M %p")) # ou... Add solution
Best helpers
Ranking is empty