本文整理匯總了Python中khayyam.JalaliDatetime.utcnow方法的典型用法代碼示例。如果您正苦於以下問題:Python JalaliDatetime.utcnow方法的具體用法?Python JalaliDatetime.utcnow怎麽用?Python JalaliDatetime.utcnow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類khayyam.JalaliDatetime
的用法示例。
在下文中一共展示了JalaliDatetime.utcnow方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_utcnow
# 需要導入模塊: from khayyam import JalaliDatetime [as 別名]
# 或者: from khayyam.JalaliDatetime import utcnow [as 別名]
def test_utcnow(self):
jutcnow = JalaliDatetime.utcnow()
utcnow = jutcnow.to_datetime()
self.assertEqual(jutcnow.time(), utcnow.time())
示例2: test_utcnow
# 需要導入模塊: from khayyam import JalaliDatetime [as 別名]
# 或者: from khayyam.JalaliDatetime import utcnow [as 別名]
def test_utcnow(self):
jalali_utcnow = JalaliDatetime.utcnow()
datetime_utcnow = jalali_utcnow.todatetime()
self.assertEqual(jalali_utcnow.time(), datetime_utcnow.time())