def getTimeAgo(self, timestamp): now, then = int(time.time()), int(timestamp / 1000.0) time_ago = timesince(then, now, afterword='ago', minute_granularity=True, max_no_sections=2) if not time_ago: time_ago = 'seconds ago' return time_ago
def getTimeAgo(timestamp): now, then = int(time.time()), int(timestamp / 1000.0) time_ago = timesince( then, now, afterword='ago', minute_granularity=True, max_no_sections=2) if not time_ago: time_ago = 'seconds ago' return time_ago
def getTimeAgo(timestamp): # keeping this here amongst the view code because the use of the # timesince() function is specific to the view now, then = int(time.time()), int(timestamp / 1000.0) time_ago = timesince(then, now, afterword='ago', minute_granularity=True, max_no_sections=2) if not time_ago: time_ago = 'seconds ago' return time_ago
def getTimeAgo(timestamp): # keeping this here amongst the view code because the use of the # timesince() function is specific to the view now, then = int(time.time()), int(timestamp / 1000.0) time_ago = timesince( then, now, afterword='ago', minute_granularity=True, max_no_sections=2 ) if not time_ago: time_ago = 'seconds ago' return time_ago