擅长:python、mysql、java
<p>典型的方法是定义一个格式列表(<code>strptime</code>格式),然后依次尝试,直到其中一个有效为止。例如,请参见以下配方:</p>
<p><a href="http://code.activestate.com/recipes/577135-parse-a-datetime-string-to-a-datetime-instance/" rel="nofollow">http://code.activestate.com/recipes/577135-parse-a-datetime-string-to-a-datetime-instance/</a></p>
<p><code>strptime</code>接受很多格式。如果你能列举出你所看到的所有可能性,你就应该能够把这个食谱的一个变体拼凑起来,做你想做的事。在</p>