/usr/lib/python2.7/dist-packages/FontTools/fontTools/misc/timeTools.py is in fonttools 3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | """fontTools.misc.timeTools.py -- tools for working with OpenType timestamps.
"""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
import time
import calendar
epoch_diff = calendar.timegm((1904, 1, 1, 0, 0, 0, 0, 0, 0))
def timestampToString(value):
return time.asctime(time.gmtime(max(0, value + epoch_diff)))
def timestampFromString(value):
return calendar.timegm(time.strptime(value)) - epoch_diff
def timestampNow():
return int(time.time() - epoch_diff)
def timestampSinceEpoch(value):
return int(value - epoch_diff)
|