コード例 #1
0
ファイル: utils.py プロジェクト: y00273676/O2O_ERP_Server
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
ファイル: utils.py プロジェクト: y00273676/O2O_ERP_Server
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
ファイル: test_when.py プロジェクト: kennethgunn/When.py
 def test_tomorrow(self):
     self.assertEqual(when.tomorrow(), self.today + self.one_day)
コード例 #4
0
ファイル: test_when.py プロジェクト: wsgan001/BasePython
#coding=utf8
import when

print when.timezone()

print when.today()

print when.tomorrow()

print when.now()
コード例 #5
0
ファイル: test_when.py プロジェクト: timgates42/When.py
 def test_tomorrow(self):
     """Test when.tomorrow()"""
     self.assertEqual(when.tomorrow(), self.today + self.one_day)