def tik_tik():
username = request.forms.get('username', None)
if not username:
return "username is None"
localtime = time.localtime()
timeStamp = int(time.time()) # ????
Year, Week, Day = datetime.date.fromtimestamp(timeStamp).isocalendar()
uniqMinute = timeStamp / 60 # ?????
uniqHour = uniqMinute / 60 # ?????
uniqDate = uniqHour / 24 # ????
theYear = localtime[0] # ?: 2017?
theMonth = localtime[1] # ??: 2 (2017?2?)
theDate = localtime[2] # ??: 22 (2?22)
theHour = localtime[3] # ???: 17 (17?)
theWeek = Week # ??: 8 (???)
theDay = Day # ??: 3 (?3)
tikMgr = TikTimeDBManager()
tikInfo = [username, timeStamp, uniqMinute, uniqHour, uniqDate, theYear, theMonth, theDate, theHour, theWeek, theDay]
if uniqMinute != tikMgr.getMaxUniqMinute(username):
tikMgr.insertDB(tikInfo)
else:
pass
tikMgr.closeDB()
return "tik_tik: OK"
评论列表
文章目录