Get Current Time In Hours Minutes Seconds In Python



Hello Dev,

At this time, i we’ll present you get present time in hours minutes seconds in python. This text offers you easy instance of get present time in hours minutes seconds in python. you’re going to get present time in hours minutes seconds in python. So let’s observe few step to create instance of get present time in hours minutes seconds in python.

Instance 1


import time

// get present time in hour, minute, seconds
currentTime = time.strftime("%H:%M:%S")
print(currentTime)

Output:


16:06:41

Instance 2


# from datetime import datetime

// get present date and time
currentTimeDate = datetime.now()

// get solely time
currentTime = currentTimeDate.strftime('%H:%M:%S')
print(currentTime)

Output:


16:06:41

I hope it would help you…



Komentar

Postingan populer dari blog ini

PHP 8 Multiple Select Dropdown Example

Laravel 8 Get HTTP Hostname

JQuery Drag And Drop Menu Example