Last active
June 21, 2018 16:44
-
-
Save Franck1333/b33b20306217b0dbc9f219ca3021f1eb to your computer and use it in GitHub Desktop.
This feature allow you to get system time in many different format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: cp1252 -*- | |
#Aides: https://stackoverflow.com/questions/28189442/datetime-current-year-and-month-python/28189525 | |
from datetime import datetime | |
def temps_actuel(): | |
currentSecond= datetime.now().second #Obtention de la Seconde Actuel | |
currentMinute = datetime.now().minute #Obtention de la Minute Actuel | |
currentHour = datetime.now().hour #Obtention de l'Heure Actuel | |
currentDay = datetime.now().day #Obtention du Jour Actuel | |
currentMonth = datetime.now().month #Obtention du Mois Actuel | |
currentYear = datetime.now().year #Obtention de l'Année en cours... | |
print("Il est:" , currentHour,":",currentMinute,":",currentSecond) #Affichage de l'Heure,Minute,Seconde | |
print("Nous sommes le:",currentDay,"/",currentMonth) #Affichage de la Date "Jour,Mois" | |
print("Nous sommes en:",currentYear) #Affichage de l'Année en cours.... | |
return currentHour,currentMinute,currentSecond,currentDay,currentMonth,currentYear #Toute les données obtenues sont retourné dans le cadre d'une future utilisations de celles-ci | |
if __name__ == "__main__": | |
temps_actuel() #Fonctionnalité permettant d'Obtenir le Temps Système Actuel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment