Reputation: 15
x = difference.total_seconds
if difference < timedelta(minutes=60):
minutes = int(x/60) % 60
return "%i minutes ago" % minutes
Why I have
unsupported operand type(s) for /: 'builtin_function_or_method' and 'int'
and how can I fix it?
Upvotes: 0
Views: 11231
Reputation: 746
Your difference.total_seconds is a builtin_function_or_method. You may try:
x = difference.total_seconds()
Upvotes: 1