# How to get the epoch timestamp in Python?

In Python, how to get the epoch time (the number of seconds since epoch)?

In Python, you can get the epoch time by calling `time.time()` which return a floating number:

``````import time

print time.time()
``````

If you would like to get only the number of seconds, you may convert it to an integer.

One example is as follows.

``````\$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
{"ft_lang_label":"__label__en","ft_lang_prob":0.7831081,"math_prob":0.95648575,"size":555,"snap":"2022-40-2023-06","text_gpt3_token_len":161,"char_repetition_ratio":0.123411976,"word_repetition_ratio":0.0,"special_character_ratio":0.35855857,"punctuation_ratio":0.18181819,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9625799,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-04T16:12:26Z\",\"WARC-Record-ID\":\"<urn:uuid:b1809d6a-1d30-46fe-b02b-b2be65c9ab16>\",\"Content-Length\":\"129592\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0eb47547-3e7e-43c5-a4d0-b40ee2c2746e>\",\"WARC-Concurrent-To\":\"<urn:uuid:c3d17604-a426-42c5-a493-d8a92657031e>\",\"WARC-IP-Address\":\"104.21.34.36\",\"WARC-Target-URI\":\"https://www.systutorials.com/how-to-get-the-epoch-timestamp-in-python/\",\"WARC-Payload-Digest\":\"sha1:PAA7BTGDSSTHAZLCEMTZBC64Q7NTD2HL\",\"WARC-Block-Digest\":\"sha1:ARJTCLUSX46SA77UWVBXCL4VXRN3STUP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500140.36_warc_CC-MAIN-20230204142302-20230204172302-00545.warc.gz\"}"}