⊗pyPmTmEDO 192 of 208 menu

Getting Date from epoch format in Python

To output a date from the epoch format, you need to use the ctime method. Its parameter is passed epoch.

Let's get the current date by converting epoch:

dt = time.time() res = time.ctime(dt) print(res) # will display the current date

Get the current date from the epoch format.

byenru