Exemplo n.º 1
0
tm = timeStamp.toSeconds()
tupletime = time.localtime(tm)
string = time.strftime("%Y %b %d %H:%M:%S", tupletime)
print string
string = time.strftime("%x", tupletime)
print string
string = time.strftime("%X", tupletime)
print string
string = time.strftime("%c %Z", tupletime)
print string
another = TimeStamp(timeStamp.getSecondsPastEpoch(), timeStamp.getNanoseconds())
print "seconds ", another.toSeconds()
if not timeStamp == another:
    print "timeStamp==another failed"
print "seconds ", another.toSeconds()
another.add(1.1)
print " after += 1.1 seconds ", another.toSeconds()
if timeStamp == another:
    print "timeStamp==another failed"
if not timeStamp < another:
    print "timeStamp==another failed"
if not timeStamp <= another:
    print "timeStamp<=another failed"
if timeStamp > another:
    print "timeStamp>another failed"
if timeStamp >= another:
    print "timeStamp>=another failed"
diff = another.toSeconds() - timeStamp.toSeconds()
print "diff", diff
another.sub(0.1)
diff = another.toSeconds() - timeStamp.toSeconds()
Exemplo n.º 2
0
tupletime = time.localtime(tm)
string = time.strftime("%Y %b %d %H:%M:%S", tupletime)
print string
string = time.strftime("%x", tupletime)
print string
string = time.strftime("%X", tupletime)
print string
string = time.strftime("%c %Z", tupletime)
print string
another = TimeStamp(timeStamp.getSecondsPastEpoch(),
                    timeStamp.getNanoseconds())
print "seconds ", another.toSeconds()
if not timeStamp == another:
    print "timeStamp==another failed"
print "seconds ", another.toSeconds()
another.add(1.1)
print " after += 1.1 seconds ", another.toSeconds()
if timeStamp == another:
    print "timeStamp==another failed"
if not timeStamp < another:
    print "timeStamp==another failed"
if not timeStamp <= another:
    print "timeStamp<=another failed"
if timeStamp > another:
    print "timeStamp>another failed"
if timeStamp >= another:
    print "timeStamp>=another failed"
diff = another.toSeconds() - timeStamp.toSeconds()
print "diff", diff
another.sub(.1)
diff = another.toSeconds() - timeStamp.toSeconds()