0

How can I print the current GMT time into a 13 digit Linux timestamp? I need to submit it as dictionary in header object.

andreas
  • 16,357
  • 12
  • 72
  • 76
Shekhar Samanta
  • 875
  • 2
  • 12
  • 25
  • 2
    Possible duplicate of [How can I convert a datetime object to milliseconds since epoch (unix time) in Python?](https://stackoverflow.com/questions/6999726/how-can-i-convert-a-datetime-object-to-milliseconds-since-epoch-unix-time-in-p) – peterdn Dec 06 '17 at 10:23

1 Answers1

0

according to python 2.7 documentation :

 `import time`
 `time.gmtine()`

will return a time.struct_time object which represent the following:

Index   Attribute   Values

0   tm_year (for example, 1993)

1   tm_mon  range [1, 12]

2   tm_mday range [1, 31]

3   tm_hour range [0, 23]

4   tm_min  range [0, 59]

5   tm_sec  range [0, 61]; see (2) in strftime() description

6   tm_wday range [0, 6], Monday is 0

7   tm_yday range [1, 366]

8   tm_isdst    0, 1 or -1; see below

maybe it will help you. link to docs: https://docs.python.org/2.7/library/time.html#time.strptime

ddor254
  • 1,570
  • 1
  • 12
  • 28