예제 #1
0
파일: history.py 프로젝트: ta1hia/balrog
 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
예제 #2
0
파일: history.py 프로젝트: njirap/balrog
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
예제 #3
0
파일: base.py 프로젝트: mozmark/balrog
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
예제 #4
0
파일: base.py 프로젝트: MDTsai/balrog
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