# SPDX-FileCopyrightText: 2026 Jay Martin
#
# SPDX-License-Identifier: MIT
"""Code to set the time and date and day"""

import time
import board
from adafruit_pcf8523.pcf8523 import PCF8523

i2c = board.STEMMA_I2C()
rtc = PCF8523(i2c)

# Change the last line of code to the current time. The format is
# year, month, date, hour, minute, second, day of the week, -1, -1.
# For the hour, midnight is 0, noon is 12, and 1 p.m. is 13, etc.
# For the day of the week, Sunday is 6, Monday is 0, Tuesday is 1.
# This example sets the time to March 21, 2026, 4:45 p.m., Saturday:
# rtc.datetime = time.struct_time((2026, 3, 21, 16, 45, 0, 5, -1, -1))

rtc.datetime = time.struct_time((2026, 3, 21, 16, 45, 0, 5, -1, -1))