예제 #1
0
 def _format_time_ago(time):
     build_time = parser.parse(time)
     if build_time.tzinfo:
         build_time = build_time.astimezone(pytz.utc).replace(tzinfo=None)
     delta = datetime.utcnow() - build_time
     return timeago(delta)
예제 #2
0
def test_timeago(delta, expected):
    assert_equals(timeago(delta), expected)