Semaine 4, jour 5

This commit is contained in:
gauvainboiche
2026-01-16 17:13:01 +01:00
parent 54bb4d7628
commit 3f609ad139
38 changed files with 556 additions and 10 deletions

View File

@@ -0,0 +1,42 @@
from datetime import date, time, datetime, timedelta
import pytz
date_2026 = date(2026, 1, 10)
print(date_2026)
today = date.today()
print(today)
hour = time()
print(hour)
hour = time(12, 34, 23)
print(hour)
hour_now = datetime.now().time()
print(hour_now)
day_now = datetime.now().date()
print(day_now)
timezone_paris = pytz.timezone("Europe/Paris")
timezone_moscou = pytz.timezone("Europe/Moscow")
timezone_pyongyang = pytz.timezone("Asia/Pyongyang")
heure_actuelle_paris = datetime.now(tz= timezone_paris)
heure_actuelle_moscou = datetime.now(tz= timezone_moscou)
heure_actuelle_pyongyang = datetime.now(tz= timezone_pyongyang)
print(heure_actuelle_paris)
print(heure_actuelle_moscou)
print(heure_actuelle_pyongyang)
date_15_jours = date.today() + timedelta(days= 15)
print(date_15_jours)
debut_voyage = datetime(2026, 1, 16, 12, 7, 18, tzinfo= timezone_paris)
fin_voyage = datetime(2026, 12, 25, 13, 56, 23, tzinfo= timezone_pyongyang)
print(debut_voyage - fin_voyage)
detail_voyage = debut_voyage - fin_voyage
print(detail_voyage.days)
print(detail_voyage.seconds)