Skip to content

Instantly share code, notes, and snippets.

@rvause
Last active December 12, 2015 01:29
Show Gist options
  • Select an option

  • Save rvause/4691869 to your computer and use it in GitHub Desktop.

Select an option

Save rvause/4691869 to your computer and use it in GitHub Desktop.
Not working in all timezones, need to fix
from jingo import register
@register.filter
def beats(obj):
t = obj.timetuple()
bmt = (t.tm_hour * 3600) + (t.tm_min * 60) + t.tm_sec
return '%.0f' % (bmt / 86.375)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment