Permalink
Browse files

Add functions to calculate milliseconds since epoch

  • Loading branch information...
1 parent 65dbf92 commit bc432cf1c16836d29b025eaa85cb4d7fbae68734 @harishvc committed Feb 22, 2015
Showing with 8 additions and 0 deletions.
  1. +8 −0 MyMoment.py
View
@@ -39,3 +39,11 @@ def MT():
def FT():
fmt = '%d%b%Y-%H%M%S'
return ( datetime.datetime.now(pytz.timezone("America/Los_Angeles")).strftime(fmt) )
+
+#Time now in epoch milliseconds
+def TNEM():
+ return (int(datetime.datetime.now().strftime("%s")) * 1000)
+
+#Time then (back in minutes) is epoch milliseconds
+def TTEM(Back):
+ return (int(datetime.datetime.now().strftime("%s")) * 1000 - (Back * 60 * 1000))

0 comments on commit bc432cf

Please sign in to comment.