本文整理汇总了Python中DateTime.localtime方法的典型用法代码示例。如果您正苦于以下问题:Python DateTime.localtime方法的具体用法?Python DateTime.localtime怎么用?Python DateTime.localtime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTime
的用法示例。
在下文中一共展示了DateTime.localtime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: import DateTime [as 别名]
# 或者: from DateTime import localtime [as 别名]
def Main():
form = cgi.FormContent()
now, secs = decide_time(form) # Figure out the time wanted by the form values
data = "c11, c12" # Default to temperature maps
if form.has_key("data"):
data = form["data"][0]
data = regsub.gsub('_',' ', data)
req_time = DateTime.localtime(secs) # Convert this into a DateTime format
style.header("Campbell Data Plotter","white") # Setup HTML
print '<TABLE width="100%">'
print '<TR><TH bgcolor="red"><font color="white">Select Data Type:</TH>'
print '<TH colspan="6" bgcolor="blue"><font color="white">Navigation:</TH>'
print '</TR>'
print '<TR><TD>'
data_options(data, secs)
print '</TD><TD>'
prev_year(data, req_time)
print '</TD><TD>'
prev_month(data, req_time)
print '</TD><TD>'
prev_day(data, req_time)
print '</TD><TD>'
next_day(data, req_time)
print '</TD><TD>'
next_month(data, req_time)
print '</TD><TD>'
next_year(data, req_time)
print '</TD></TR>'
print '</TABLE>'
if float(now) < float(secs) :
print '<H1>You expect me to plot into the future? I am good, but not that good :)</H1>'
else:
plot.plot(data, secs)
print '<BR><BR><a href="/campbell/index.html">ISU Campbell Homepage</a>'
示例2: _dateConvertFromDB
# 需要导入模块: import DateTime [as 别名]
# 或者: from DateTime import localtime [as 别名]
def _dateConvertFromDB(dbd):
return DateTime.localtime(dbd)