Encoding datetime for JSON consumers like YUI

1
2
3
4
# Unlike datetime.isoformat(), this works in UTC and has the trailing Z which is
# required by JSON parsers such as YAHOO.lang.JSON.stringToDate:

time.strftime('%Y-%m-%dT%H:%M:%SZ', date.utctimetuple())

More like this

  1. JSON encode ISO UTC datetime by japerk 4 years, 1 month ago
  2. parse date template tag by robhudson 3 years, 7 months ago
  3. YUI editor for flatpages inside admin interface by nnrcschmdt 5 years, 2 months ago
  4. YUI Autocomplete by pigletto 5 years, 9 months ago
  5. UTC-based astimezone filter by miracle2k 1 year, 6 months ago

Comments

(Forgotten your password?)