本文整理汇总了Python中Time.formatted_date_to_timestamp方法的典型用法代码示例。如果您正苦于以下问题:Python Time.formatted_date_to_timestamp方法的具体用法?Python Time.formatted_date_to_timestamp怎么用?Python Time.formatted_date_to_timestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time.formatted_date_to_timestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_latest_t0_status
# 需要导入模块: import Time [as 别名]
# 或者: from Time import formatted_date_to_timestamp [as 别名]
def get_latest_t0_status(db_con,table_name,t0):
sql_dump = "SELECT * FROM "+ table_name +" ORDER BY id DESC LIMIT 1"
df = psql.read_frame(sql_dump, db_con)
# This condition might be occured at first time running
if df.empty:
print 'empty data frame..'
return t0
# Previous id_event = None, means there is no previous flood happened
if (df.ix[0]['id_event'] == None):
print 'No flood at previous time ... t0 is changing'
return t0
# Previous id_event != None, means there is flood at previous time
else:
print 'There is flood at previous time ... t0 is not changing'
t0 = str(df.ix[0]['t0'])
t0_timestamp = t.formatted_date_to_timestamp(t0,psql_time_format)
t0 = t.timestamp_to_formatted_date(t0_timestamp,std_time_format)
return t0