Converting datetime to Javascript milliseconds in epoch

1
2
3
4
from time import mktime

def datetime_to_ms_str(dt):
    return str(1000*mktime(dt.timetuple()))

More like this

  1. HTML/JS template filter to show localized dates/times by mback2k 2 years, 10 months ago
  2. Parse datetime model field to string by jzelez 1 year, 7 months ago
  3. DateTimeFluxCapacitor by jbcurtin 1 year ago
  4. JSON decode datetime by japerk 2 years, 10 months ago
  5. JSON encode ISO UTC datetime by japerk 2 years, 10 months ago

Comments

(Forgotten your password?)