def time_since(d, now=None, count=2, accuracy=6, simple=False):
 if (isinstance(d, int) or isinstance(d, float)):
  d = datetime.datetime.fromtimestamp(d)
 if (isinstance(now, int) or isinstance(now, float)):
  now = datetime.datetime.fromtimestamp(now)
 if (not isinstance(d, datetime.datetime)):
  d = datetime.datetime(d.year, d.month, d.day)
 if (now and (not isinstance(now, datetime.datetime))):
  now = datetime.datetime(now.year, now.month, now.day)
 if (not now):
  now = datetime.datetime.now()
 delta = (now - (d - datetime.timedelta(0, 0, d.microsecond)))
 since = ((((delta.days * 24) * 60) * 60) + delta.seconds)
 if (since <= 0):
  return ('0 ' + 'minutes')
 return format_time(since, count, accuracy, simple)

def time_since ( d , now = None , count = 2 , accuracy = 6 , simple = False ) : if ( isinstance ( d , int ) or isinstance ( d , float ) ) : d = datetime . datetime . fromtimestamp ( d ) if ( isinstance ( now , int ) or isinstance ( now , float ) ) : now = datetime . datetime . fromtimestamp ( now ) if ( not isinstance ( d , datetime . datetime ) ) : d = datetime . datetime ( d . year , d . month , d . day ) if ( now and ( not isinstance ( now , datetime . datetime ) ) ) : now = datetime . datetime ( now . year , now . month , now . day ) if ( not now ) : now = datetime . datetime . now ( ) delta = ( now - ( d - datetime . timedelta ( 0 , 0 , d . microsecond ) ) ) since = ( ( ( ( delta . days * 24 ) * 60 ) * 60 ) + delta . seconds ) if ( since <= 0 ) : return ( '0 ' + 'minutes' ) return format_time ( since , count , accuracy , simple )
returns a string representing time since e .