debugtalk.py 1.5 KB
import json
import time
from urllib import parse

from helpfunc.db_func import *
from helpfunc.header_func import *
from helpfunc.login_func import *
from helpfunc.pg_db_loot_func import *
from helpfunc.pg_db_bid_func import *
from helpfunc.pg_db_appoint_func import *


import time,datetime,re


from urllib.parse import *


def sleep(n_secs):
    time.sleep(n_secs)

def convert_to_string(value):
    return str(value)

def convert_to_number(value):
    return int(value)


def get_nowtime():
    return time.strftime("%Y%m%d%H%M%S",time.localtime(time.time()))


def get_starttime():
    now = datetime.datetime.now()
    start_time = now - datetime.timedelta(hours=now.hour, minutes=now.minute, seconds=now.second, microseconds=now.microsecond)
    start_time = str(start_time)
    start_time = int(time.mktime(time.strptime(start_time, "%Y-%m-%d %H:%M:%S")))*1000
    return start_time


def get_endtime():
    now = datetime.datetime.now()
    start_time = now - datetime.timedelta(hours=now.hour, minutes=now.minute, seconds=now.second,
                                          microseconds=now.microsecond)
    end_time = start_time + datetime.timedelta(hours=23, minutes=59, seconds=59)
    end_time = str(end_time)
    end_time = int(time.mktime(time.strptime(end_time, "%Y-%m-%d %H:%M:%S")))*1000
    return end_time


def add(x, y):
    return int(int(x)+y)


#获取secret用于子系统单点登录
def get_secret(url):
    urllist = url.split('code=',1)
    code = urllist[1]
    de_code = parse.unquote(code)
    return de_code