/usr/share/pyshared/mx/DateTime/mxDateTime/testticks.py is in python-egenix-mxdatetime 3.2.1-1ubuntu1.
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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | from mx.DateTime import *
import time,sys
print 'Python',sys.version.split()[0],'on',sys.platform
print
x = time.time()
print 'ticks:',x
print 'time.localtime():',time.localtime(x)
print 'time.gmtime():',time.gmtime(x)
print 'time.mktime():',time.mktime(time.localtime(x)[:-1]+(-1,))
t = DateTimeFromTicks(x)
print 't.ticks():',t.ticks()
print 't.tuple():',t.tuple()
print 't.absdate:',t.absdate
print 't.abstime:',t.abstime
print 't.tuple() -> time.mktime():',apply(time.mktime,t.tuple())
print ' -> time.localtime():',time.localtime(apply(time.mktime,t.tuple()))
print "hasattr(Epoch,'gmticks'):",hasattr(Epoch,'gmticks')
try:
print 'tz_offset(t):',tz_offset(t)
except:
print 'tz_offset not working'
print
x = x - 15768000
print 'ticks:',x
print 'time.localtime():',time.localtime(x)
print 'time.gmtime():',time.gmtime(x)
print 'time.mktime():',time.mktime(time.localtime(x)[:-1]+(-1,))
t = DateTimeFromTicks(x)
print 't.ticks():',t.ticks()
print 't.tuple():',t.tuple()
print 't.absdate:',t.absdate
print 't.abstime:',t.abstime
print 't.tuple() -> time.mktime():',apply(time.mktime,t.tuple())
print ' -> time.localtime():',time.localtime(apply(time.mktime,t.tuple()))
print "hasattr(Epoch,'gmticks'):",hasattr(Epoch,'gmticks')
try:
print 'tz_offset(t):',tz_offset(t)
except:
print 'tz_offset not working'
|