- Author:
- waitinforatrain
- Posted:
- November 30, 2011
- Language:
- Python
- Version:
- 1.3
- Score:
- 0 (after 0 ratings)
Template tag to convert number of seconds into mm:ss format
1 2 3 4 5 | @register.filter()
def formatSeconds(s):
mins = math.floor(s / 60);
secs = math.floor(s - (mins * 60));
return "%d:%02d" % (mins, secs);
|
More like this
- Add custom fields to the built-in Group model by jmoppel 1 month, 2 weeks ago
- Month / Year SelectDateWidget based on django SelectDateWidget by pierreben 5 months ago
- Python Django CRUD Example Tutorial by tuts_station 5 months, 2 weeks ago
- Browser-native date input field by kytta 7 months ago
- Generate and render HTML Table by LLyaudet 7 months, 1 week ago
Comments
Please login first before commenting.