def get_today_start_end_time(st, ed): today = when.today() format_str = '%s %s' if st < ed: st_time_str = format_str % (today, st) ed_time_str = format_str % (today, ed) return st_time_str, ed_time_str tomorrow = when.tomorrow() st_time_str = format_str % (today, st) ed_time_str = format_str % (tomorrow, ed) return st_time_str, ed_time_str
def get_30days_start_end_time(st, ed): today = when.today() thirty_days_ago = when.past(days=30).date() format_str = '%s %s' if st < ed: st_time_str = format_str % (thirty_days_ago, st) ed_time_str = format_str % (today, ed) return st_time_str, ed_time_str tomorrow = when.tomorrow() st_time_str = format_str % (thirty_days_ago, st) ed_time_str = format_str % (tomorrow, ed) return st_time_str, ed_time_str
def test_tomorrow(self): self.assertEqual(when.tomorrow(), self.today + self.one_day)
#coding=utf8 import when print when.timezone() print when.today() print when.tomorrow() print when.now()
def test_tomorrow(self): """Test when.tomorrow()""" self.assertEqual(when.tomorrow(), self.today + self.one_day)