Cleanup different places using unix_time()
This commit is contained in:
parent
eabcb3d39c
commit
705ec314a3
15 changed files with 60 additions and 82 deletions
|
|
@ -1,5 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
import datetime
|
||||
import random
|
||||
import string
|
||||
|
||||
|
|
@ -12,17 +11,6 @@ def generate_receipt_handle():
|
|||
return ''.join(random.choice(string.ascii_lowercase) for x in range(length))
|
||||
|
||||
|
||||
def unix_time(dt=None):
|
||||
dt = dt or datetime.datetime.utcnow()
|
||||
epoch = datetime.datetime.utcfromtimestamp(0)
|
||||
delta = dt - epoch
|
||||
return (delta.days * 86400) + (delta.seconds + (delta.microseconds / 1e6))
|
||||
|
||||
|
||||
def unix_time_millis(dt=None):
|
||||
return unix_time(dt) * 1000.0
|
||||
|
||||
|
||||
def parse_message_attributes(querystring, base='', value_namespace='Value.'):
|
||||
message_attributes = {}
|
||||
index = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue