Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print the current time in the format Day, Date Month Year HH:MM:SS?

How to print the current time in the format Day, Date Month Year HH:MM:SS

Mon, 28 Aug 2017 15:37:01 .

And then, convert this timestamp to epoch seconds & vice-versa.

like image 695
Diesel Kumar Avatar asked Oct 19 '25 03:10

Diesel Kumar


1 Answers

datetime module does all the job

>>> import datetime
>>> datetime.datetime.now().strftime("%a, %d %B %Y %H:%M:%S")
'Tue, 29 August 2017 03:04:21'
like image 111
Panagiotis Simakis Avatar answered Oct 21 '25 19:10

Panagiotis Simakis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!