def nth_day_of_week(self, subtree):
if subtree.label().startswith('first'):
n = 0
if subtree.label().startswith('second'):
n = 1
if subtree.label().startswith('third'):
n = 2
if subtree.label().startswith('fourth'):
n = 3
if subtree.label().startswith('fifth'):
n = 4
if subtree.label().startswith('sixth'):
n = 5
if subtree.label().startswith('seventh'):
n = 6
d = dt.today()
self.dictionary['timestamp'] = self.next_weekday(d, n)
评论列表
文章目录