コード例 #1
0
def check_it():
    checkURL = "http://mirrors.zju.edu.cn/centos/timestamp.txt"
    with urllib.request.urlopen(checkURL) as response:
        plain_string = str(response.read())
        timestruct = time.strptime(plain_string, "b'%a %b  %d %H:%M:%S %Z %Y\\n'")
        timestamp = tstt.convert(timestruct, tstt.find_tmzone(plain_string))
        return compare.compare(timestamp, 3600 * 24 * 1.5)
コード例 #2
0
def check_it():
    checkURL = "http://mirrors.zju.edu.cn/postgresql/sync_timestamp"
    with urllib.request.urlopen(checkURL) as response:
        plain_string = str(response.read())
        timestruct = time.strptime(plain_string, "b'%Y-%m-%d %H:%M:%S %Z\\n'")
        timestamp = tstt.convert(timestruct, tstt.find_tmzone(plain_string))
        return compare.compare(timestamp, 3600 * 24 * 2.5)
コード例 #3
0
def check_it():
    checkURL = "http://mirrors.zju.edu.cn/debian/project/trace/ftp-master.debian.org"
    with urllib.request.urlopen(checkURL) as response:
        plain_string = response.read()
        time_line = plain_string.decode().split("\n")[0]
        timestruct = time.strptime(time_line, "%a %b  %d %H:%M:%S %Z %Y")
        timestamp = tstt.convert(timestruct, tstt.find_tmzone(time_line))
        return compare.compare(timestamp, 3600 * 24 * 1.5)