title: Js Date object to python datetime
body: <p>I am working with dhtmlxscheduler and I am sending dates to the django server for processing.</p>
  
  <p>Dhtmlxscheduler provides me with the following date object, the methods provided start from the second line below:</p>
  
  <pre><code>end_date: Sat Nov 19 2011 01:00:00 GMT-0500 (EST)
  __proto__: Invalid Date
  constructor: function Date() { [native code] }
  getDate: function getDate() { [native code] }
  getDay: function getDay() { [native code] }
  getFullYear: function getFullYear() { [native code] }
  getHours: function getHours() { [native code] }
  getMilliseconds: function getMilliseconds() { [native code] }
  getMinutes: function getMinutes() { [native code] }
  getMonth: function getMonth() { [native code] }
  getSeconds: function getSeconds() { [native code] }
  getTime: function getTime() { [native code] }
  getTimezoneOffset: function getTimezoneOffset() { [native code] }
  getUTCDate: function getUTCDate() { [native code] }
  getUTCDay: function getUTCDay() { [native code] }
  getUTCFullYear: function getUTCFullYear() { [native code] }
  getUTCHours: function getUTCHours() { [native code] }
  getUTCMilliseconds: function getUTCMilliseconds() { [native code] }
  getUTCMinutes: function getUTCMinutes() { [native code] }
  getUTCMonth: function getUTCMonth() { [native code] }
  getUTCSeconds: function getUTCSeconds() { [native code] }
  getYear: function getYear() { [native code] }
  setDate: function setDate() { [native code] }
  setFullYear: function setFullYear() { [native code] }
  setHours: function setHours() { [native code] }
  setMilliseconds: function setMilliseconds() { [native code] }
  setMinutes: function setMinutes() { [native code] }
  setMonth: function setMonth() { [native code] }
  setSeconds: function setSeconds() { [native code] }
  setTime: function setTime() { [native code] }
  setUTCDate: function setUTCDate() { [native code] }
  setUTCFullYear: function setUTCFullYear() { [native code] }
  setUTCHours: function setUTCHours() { [native code] }
  setUTCMilliseconds: function setUTCMilliseconds() { [native code] }
  setUTCMinutes: function setUTCMinutes() { [native code] }
  setUTCMonth: function setUTCMonth() { [native code] }
  setUTCSeconds: function setUTCSeconds() { [native code] }
  setYear: function setYear() { [native code] }
  toDateString: function toDateString() { [native code] }
  toGMTString: function toGMTString() { [native code] }
  toISOString: function toISOString() { [native code] }
  toJSON: function toJSON() { [native code] }
  toLocaleDateString: function toLocaleDateString() { [native code] }
  toLocaleString: function toLocaleString() { [native code] }
  toLocaleTimeString: function toLocaleTimeString() { [native code] }
  toString: function toString() { [native code] }
  toTimeString: function toTimeString() { [native code] }
  toUTCString: function toUTCString() { [native code] }
  valueOf: function valueOf() { [native code] }
  __proto__: Object
  </code></pre>
  
  <p>What is the easiest method for choosing one of these toString methods and then parsing it on the python server side using datetime.strptime() to create a python datetime object?</p>
  
  <p>The simple toString method returns me a datetime in the format:</p>
  
  <pre><code>Sat Nov 19 2011 00:00:00 GMT-0500 (EST)
  </code></pre>
  
  <p>Trying the different format directives proves unsuccessful.</p>
  
  <p>ie:</p>
  
  <pre><code>datetime.strptime("Sat Nov 19 2011 00:00:00 GMT-0500 (EST)", "%a %b %d %Y %H:%M:%S %Z") 
  ---&gt; unconverted data remains: -0500 (EST)
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>datetime.strptime("Sat Nov 19 2011 00:00:00 GMT-0500 (EST)", "%a %b %d %Y %H:%M:%S %z") 
  ---&gt; ValueError: 'z' is a bad directive in format '%a %b %d %Y %H:%M:%S %z'
  </code></pre>