本文整理汇总了Python中memacs.lib.orgformat.OrgFormat.datetimerange方法的典型用法代码示例。如果您正苦于以下问题:Python OrgFormat.datetimerange方法的具体用法?Python OrgFormat.datetimerange怎么用?Python OrgFormat.datetimerange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类memacs.lib.orgformat.OrgFormat
的用法示例。
在下文中一共展示了OrgFormat.datetimerange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_utcrange
# 需要导入模块: from memacs.lib.orgformat import OrgFormat [as 别名]
# 或者: from memacs.lib.orgformat.OrgFormat import datetimerange [as 别名]
def test_utcrange(self):
self.assertEqual(
OrgFormat.utcrange(
time.struct_time([1980,12,31,23,59,58,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
),
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,58,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
)
)
self.assertEqual(
OrgFormat.utcrange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
),
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
)
)
self.assertEqual(
OrgFormat.utcrange(
time.struct_time([1980,12,31,0,0,0,0,0,0]),
time.struct_time([1981,1,15,0,0,0,0,0,0]),
),
OrgFormat.daterange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
)
)
示例2: test_date_ranges
# 需要导入模块: from memacs.lib.orgformat import OrgFormat [as 别名]
# 或者: from memacs.lib.orgformat.OrgFormat import datetimerange [as 别名]
def test_date_ranges(self):
daterange = OrgFormat.daterange(
OrgFormat.datetupeliso8601("2011-11-29"), OrgFormat.datetupeliso8601("2011-11-30")
)
self.assertEqual(daterange, "<2011-11-29 Tue>--<2011-11-30 Wed>")
datetimerange = OrgFormat.datetimerange(
OrgFormat.datetimetupeliso8601("2011-11-30T21.06.02"), OrgFormat.datetimetupeliso8601("2011-11-30T22.06.02")
)
self.assertEqual(datetimerange, "<2011-11-30 Wed 21:06>--<2011-11-30 Wed 22:06>")
示例3: test_datetimerange
# 需要导入模块: from memacs.lib.orgformat import OrgFormat [as 别名]
# 或者: from memacs.lib.orgformat.OrgFormat import datetimerange [as 别名]
def test_datetimerange(self):
self.assertEqual(
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,58,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
),
u'<1980-12-31 Wed 23:59>--<1981-01-15 Thu 15:30>' ) ## seconds are not (yet) defined in Org-mode
self.assertEqual(
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
),
u'<1980-12-31 Wed 23:59>--<1981-01-15 Thu 15:30>' )
self.assertEqual(
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,0,0,0,0]),
),
u'<1980-12-31 Wed 23:59>--<1981-01-15 Thu 15:30>' )
示例4: test_datetimerange
# 需要导入模块: from memacs.lib.orgformat import OrgFormat [as 别名]
# 或者: from memacs.lib.orgformat.OrgFormat import datetimerange [as 别名]
def test_datetimerange(self):
self.assertEqual(
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,58,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
),
u'<1980-12-31 Mon 23:59:58>--<1981-01-15 Mon 15:30:02>' ) ## however, it was Wednesday to Thursday
self.assertEqual(
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,02,0,0,0]),
),
u'<1980-12-31 Mon 23:59>--<1981-01-15 Mon 15:30:02>' ) ## however, it was Wednesday to Thursday
self.assertEqual(
OrgFormat.datetimerange(
time.struct_time([1980,12,31,23,59,0,0,0,0]),
time.struct_time([1981,1,15,15,30,0,0,0,0]),
),
u'<1980-12-31 Mon 23:59>--<1981-01-15 Mon 15:30>' ) ## however, it was Wednesday to Thursday