Skip to content

Instantly share code, notes, and snippets.

View ronan-cunningham's full-sized avatar

Ronan Cunningham ronan-cunningham

  • 1972
  • Belfast, Ireland
View GitHub Profile
@ronan-cunningham
ronan-cunningham / ttl.py
Last active June 18, 2021 21:57
Create a DynamoDb time to live value using a number of days as an input
import time
def get_ttl(days: int) -> int:
seconds_since_epoch=int(str(time.time()).split('.')[0])
seconds_in_n_days=days * 86400
time_to_live=seconds_since_epoch + seconds_in_n_days
return time_to_live