You can use the datetime module in Python to get the current time. Here's how:
main.py95 chars6 lines
This will output the current date and time in the following format: "YYYY-MM-DD HH:MM:SS.ssssss".
You can also format the output to display just the time by using the strftime() method:
main.py119 chars5 lines
This will output the current time in the following format: "HH:MM:SS".
gistlibby LogSnag