本文整理汇总了Python中nntplib.NNTP.date方法的典型用法代码示例。如果您正苦于以下问题:Python NNTP.date方法的具体用法?Python NNTP.date怎么用?Python NNTP.date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nntplib.NNTP
的用法示例。
在下文中一共展示了NNTP.date方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadLastread
# 需要导入模块: from nntplib import NNTP [as 别名]
# 或者: from nntplib.NNTP import date [as 别名]
exit
seen = []
newdate = None
print "Reading date and seen files"
date,seen = loadLastread()
for serverentry in servers:
server = serverentry[0]
newsgroups = serverentry[2]
print "Connecting to: " + server
s = NNTP(server)
for newsgroup in newsgroups:
feedGroup(server, newsgroup, date, seen)
serverdate = s.date()
date = serverdate[1]
time = serverdate[2]
year = 2000 + int(serverdate[1][0:2]) ## So I got a Y3K problem here. Deal.
month = int(serverdate[1][2:4])
day = int(serverdate[1][4:])
hour = int(serverdate[2][0:2])
minute = int(serverdate[2][2:4])
second = int(serverdate[2][4:])
newdate = datetime.datetime(year,month,day,hour,minute,second)
print "Server time is " + str(newdate)
if not newdate == None:
print "Got a new server time, storing that"
else:
newdate = date