Mmrz-Sync.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Mmrz-Sync 作者: zhanglintc 项目源码 文件源码
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"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号