Myvideo

Guest

Login

Python time module

Uploaded By: Myvideo
1 view
0
0 votes
0

python time module tutorial example explained #python #time #module # *************************************************************************** import time # *************************************************************************** print((0)) # convert a time expressed in seconds since epoch to a readable string # epoch = when your computer thinks time began (reference point) print(()) # return current seconds since epoch print((())) # will get current time # *************************************************************************** # (format, time_object) = formats a time_object to a string # time_object = () # local time # time_object = () # UTC time # local_time = (“%B %d %Y %H:%M:%S“, time_object) # print(local_time) # *************************************************************************** # (string_string, format) = parses a string representing time/date and returns a struct_time object # time_string = “20 April, 2020“ # time_object = (time_string,“%d %B, %Y“) # print(time_object) # *************************************************************************** # (time_tuple) = accepts a time_object or a tuple up to 9 elements and returns a string # (year, month, day, hours, minutes, secs, #day of the week, #day of the year, dst) # time_tuple = (2020, 4, 20, 4, 20, 0, 0, 0, 0) # time_string = (time_tuple) # print(time_string) # *************************************************************************** # (time_tuple) = accepts a time_object or a tuple up to 9 elements and return seconds since epoch # (year, month, day, hours, minutes, secs, #day of the week, #day of the year, dst) # time_tuple = (2020, 4, 20, 4, 20, 0, 0, 0, 0) # time_string = (time_tuple) # print(time_string) # *************************************************************************** Bro Code merch store 👟 : =========================================================== =========================================================== music credits 🎼 : =========================================================== Up In My Jam (All Of A Sudden) by - Kubbi Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0 Free Download / Stream: Music promoted by Audio Library ===========================================================

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later