51
51
>>> ztapi.provideAdapter(
52
52
... datetime, IPathAdapter, TestDateTimeFormatterAPI, 'testfmt')
54
A time that is ten seconds or less will be displayed as an approximate:
56
>>> t = fixed_time + timedelta(0, 5, 0)
57
>>> test_tales('t/testfmt:approximatedate', t=t)
59
>>> t = fixed_time + timedelta(0, 9, 0)
60
>>> test_tales('t/testfmt:approximatedate', t=t)
62
>>> print (test_tales('t/testfmt:approximatedate', t=t) ==
63
... test_tales('t/testfmt:displaydate', t=t))
65
>>> t = fixed_time_utc - timedelta(0, 10, 0)
66
>>> test_tales('t/testfmt:approximatedate', t=t)
68
>>> print (test_tales('t/testfmt:approximatedate', t=t) ==
69
... test_tales('t/testfmt:displaydate', t=t))
54
72
A time that is very close to the present will be displayed in seconds:
56
>>> t = fixed_time + timedelta(0, 5, 0)
74
>>> t = fixed_time + timedelta(0, 11, 0)
57
75
>>> test_tales('t/testfmt:approximatedate', t=t)
59
77
>>> print (test_tales('t/testfmt:approximatedate', t=t) ==
60
78
... test_tales('t/testfmt:displaydate', t=t))
62
>>> t = fixed_time_utc - timedelta(0, 5, 0)
80
>>> t = fixed_time_utc - timedelta(0, 25, 0)
63
81
>>> test_tales('t/testfmt:approximatedate', t=t)
65
83
>>> print (test_tales('t/testfmt:approximatedate', t=t) ==
66
84
... test_tales('t/testfmt:displaydate', t=t))