擅长:python、mysql、java
<p>您需要非常熟悉datetime模块:<a href="http://docs.python.org/library/datetime.html" rel="nofollow">http://docs.python.org/library/datetime.html</a></p>
<p>您可以使用<code>datetime.today()</code>来获取包含年份的当前日期。datetime对象的属性使获得年、月和日变得容易。timedelta类可用于向一年的开始添加天数。你知道吗</p>
<p>datetime模块无法直接解决问题的唯一部分是计算假期。你需要有自己的方式来检查每个假期,看看日期是否匹配。你知道吗</p>