def set_clock():
    try:
        now = time.struct_time(io.receive_time(timezone))
        r = rtc.RTC()
        r.datetime = time.struct_time((now.tm_year, now.tm_mon, now.tm_mday, now.tm_hour, now.tm_min, now.tm_sec, 1, -1, -1))
    except Exception as e:
        print("Failed to set RTC: ", e)

def get_time():
    r = rtc.RTC()
    now = r.datetime
    hour = now.tm_hour
    period = "am"
    if hour > 11:
        period = "pm"
    if hour > 12:
        hour = hour - 12
    if hour == 0:
        hour = 12
    return f"{hour:01d}:{now.tm_min:02d} {period}"

def get_date():
    r = rtc.RTC()
    now = r.datetime
    return f"{now.tm_mon:1}/{now.tm_mday:2}/{now.tm_year}"