def get_current_SNTP_time(sntp_server=SNTP_SERVER):
    """ Acquires current time in UTC secs from SNTP server. """
    """ Thanks to Simon Foster's "Simple (very) SNTP client" recipe:
    http://code.activestate.com/recipes/117211/ """
    try:
        client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        data = '\x1b' + 47 * '\0'
        client.sendto(data, (sntp_server, SNTP_PORT))
        data, address = client.recvfrom(1024)
        if data:
            utc_secs = struct.unpack('!12I', data)[10]
            utc_secs -= TIME_1970
            return utc_secs
    except Exception, e:
        print "get_current_SNTP_time failed:", sntp_server
    return None
 Acquires current time in UTC secs from SNTP server. 
recipes/Python/576546_DateTimeSyncer_Daylight_Savings_Time/recipe-576546.py