Useful for transferring datetime values to JS: briefer and overcoming the 1 vs. 0 based month enumeration difference between python and JS.
1 2 3 4 | from time import mktime
def datetime_to_ms_str(dt):
return str(1000*mktime(dt.timetuple()))
|
More like this
- csrf test by zukosdead 2 weeks ago
- find even number by Rajeev529 8 months, 3 weeks ago
- Form field with fixed value by roam 9 months, 2 weeks ago
- New Snippet! by Antoliny0919 9 months, 3 weeks ago
- Add Toggle Switch Widget to Django Forms by OgliariNatan 1 year ago
Comments
Please login first before commenting.