| Issue 826: | Unix timestamp parsing: accept period | |
| 1 person starred this issue and may be notified of changes. | Back to list |
'Unix time stamp is accepted, but only iso8601 date format works.'
I'm using python2.6 & django, so the code currently looks like:
event_json.append( { 'title': "%s" % event['event_date__count'],
'start': event['event_date'].strftime("%Y-%m-%dT%H:%M:%S"),
'url': '/event/calendar/?start=%s&end=%s' % ( event['event_date'], event['event_date'] ) } )
to return a timestamp in python:
http://stackoverflow.com/questions/2775864/python-datetime-to-unix-timestamp
- edate value:
>>> edate
datetime.date(2011, 1, 15)
- returning an ISO8601 date string:
>>> edate.strftime("%Y-%m-%dT%H:%M:%S")
'2011-01-15T00:00:00'
- returning a unix timestamp:
>>> import time
>>> time.mktime( edate.timetuple() )
1295078400.0
- returning a unix timetamp string the undocumented way which only works under unix
>>> edate.strftime("%s")
'1295078400'
>>>
Apr 9, 2011
fixed in version 1.5.1. thanks!
Status:
Fixed
Aug 13, 2013
(No comment was entered for this change.)
Status:
Implemented
Aug 13, 2013
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |
Status: Accepted