本文整理汇总了Python中DateTime.mktime方法的典型用法代码示例。如果您正苦于以下问题:Python DateTime.mktime方法的具体用法?Python DateTime.mktime怎么用?Python DateTime.mktime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTime
的用法示例。
在下文中一共展示了DateTime.mktime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: import DateTime [as 别名]
# 或者: from DateTime import mktime [as 别名]
def Main():
form = cgi.FormContent()
try:
year = int(form["year"][0])
day = int(form["day"][0])
month = int(form["month"][0])
ztime = int(form["ztime"][0])
version = form["version"][0]
zswitch = form["zswitch"][0]
except:
style.SendError("Bzz, give me a date please...")
myDate = DateTime.mktime(year, month, day, ztime, 0, 0, '','','0')
secs = myDate.ticks()
time_tuple = myDate.tuple()
myDateStr = DateTime.ISO.strGMT(myDate)
SEVERE2.setupPage()
SEVERE2.printTime(myDateStr)
dir_format = myDate.strftime("/archivewx/data/%Y_%m_%d/")
print '<BASE HREF="http://www.pals.iastate.edu'+dir_format+'">'
if version == "basic":
functs.dbComments(myDateStr, "comments", "News and Notes:", zswitch)
else:
functs.db_comments_417(secs, time_tuple, "comments", "News and Notes:", "mt417")
functs.mk_data(time_tuple, 1)
if version == "basic":
functs.dbComments(myDateStr, "analysis", "Meteorological Analysis:", zswitch)
else:
functs.db_comments_417(secs, time_tuple, "analysis", "Meteorological Analysis:", "mt417")
functs.finishPage()