擅长:python、mysql、java
<p><a href="http://docs.python.org/3.3/library/datetime.html#datetime.datetime.strptime" rel="nofollow">Python comes with batteries included</a>。你知道吗</p>
<pre><code>from datetime import datetime
d1 = datetime.strptime(date1, "%m-%d-%y")
d2 = datetime.strptime(date2, "%m-%d-%y")
assert d1 > d2
</code></pre>
<p><a href="http://docs.python.org/3.3/library/datetime.html#strftime-and-strptime-behavior" rel="nofollow">What ^{<cd1>} means.</a></p>