Skip to content

Instantly share code, notes, and snippets.

@maur1th
Created February 14, 2018 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maur1th/c79da2f544d929082c03fd91f0d4a01a to your computer and use it in GitHub Desktop.
Save maur1th/c79da2f544d929082c03fd91f0d4a01a to your computer and use it in GitHub Desktop.
▶ python3
Python 3.6.4 (default, Jan 6 2018, 11:51:15)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import calendar
>>> import time
>>> calendar.timegm(time.gmtime())
1518612751
>>> import math
>>> math.log(1507037197339) / math.log(10)
12.178123971889747
>>> 1000000000000 < 1507037197339
True
>>> 10000000000000 < 1507037197339
False
>>> math.log(calendar.timegm(time.gmtime())) / math.log(10)
9.181447101299756
>>> math.log(calendar.timegm(time.gmtime()) * 1000) / math.log(10)
12.181447106733396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment