⊗pyPmTmEF 191 of 208 menu

Getting Epoch Time in Python

When working with dates in Python, there is a special format called epoch, which displays the number of milliseconds that have passed since 1th of January 1970 to the current (or specified) moment in time. This format is very convenient for transmitting and storing time data.

To get epoch, you first need to import the time module. And then apply the special time method to it. Let's get the current time in this format:

import time res = time.time() print(res) # the number of milliseconds at the current time

Display the current epoch.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline