File: helper.py

package info (click to toggle)
python-instagram 1.3.2%2Bgit20160108~dfeebe9-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 660 kB
  • ctags: 285
  • sloc: python: 1,248; makefile: 36; sh: 18
file content (10 lines) | stat: -rw-r--r-- 203 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
import calendar
from datetime import datetime


def timestamp_to_datetime(ts):
    return datetime.utcfromtimestamp(float(ts))


def datetime_to_timestamp(dt):
    return calendar.timegm(dt.timetuple())