예제 #1
0
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
예제 #2
0
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
예제 #3
0
 def test_tomorrow(self):
     self.assertEqual(when.tomorrow(), self.today + self.one_day)
예제 #4
0
#coding=utf8
import when

print when.timezone()

print when.today()

print when.tomorrow()

print when.now()
예제 #5
0
 def test_tomorrow(self):
     """Test when.tomorrow()"""
     self.assertEqual(when.tomorrow(), self.today + self.one_day)