title: python: convert year/month/day/hour/min/second to # seconds since Jan 1 1970
body: <p>I know how to do it in C and Java, but I don't know a quick way of converting year/month/day/hour/min/second to the # of seconds since the Jan 1 1970 epoch.</p>
  
  <p>Can someone help me?</p>
  
  <p>So far I've figured out how to create a <a href="http://docs.python.org/library/datetime.html" rel="noreferrer"><code>datetime</code> object</a> but I can't seem to get the elapsed # seconds since the epoch.</p>
  
  <p>(edit: my question is the inverse of this other one: <a href="https://stackoverflow.com/questions/4693915/python-seconds-since-epoch-to-relative-date">Python: Seconds since epoch to relative date</a>)</p>