I have a template tag
@register.filter
def get_total(date_start=None, date_end=None):
fmt = '%Y-%m-%d %H:%M:%S%f'
if date_start is not None and date_end is not None:
ds = str(date_start)
new_ds = ds[:19]
de = str(date_end)
new_de = de[:19]
date_start = datetime.strptime(new_ds, fmt)
date_end = datetime.strptime(new_de, fmt)
return date_end - date_start
else:
return None
and am passing it into my website as like this,
<td>{{ table.start_time|get_total:table.Date_Time_End }}</td>
One of my result look like this, "16 days, 13:39:59.900000" I dont want to see the extra 900000. Any way?