adafruit / Adafruit_CircuitPython_DS3231

Adafruit CircuitPython drivers for the DS3231 realtime clock.
MIT License
21 stars 19 forks source link

Date is showing day/month instead of month/day #43

Closed oldblackcrow closed 2 years ago

oldblackcrow commented 2 years ago

Hello. Just ran the code as it is on your page and the date displays as:

Sunday 20/5/2022

Is there a way to make it 05/20/2022?

Thanks!

tannewt commented 2 years ago

This isn't really an issue with the library. Please ask on the Adafruit forum or Discord next time.

However, you want:

    print(
        "The date is {} {}/{}/{}".format(
            days[int(t.tm_wday)], t.tm_mon, t.tm_mday, t.tm_year
        )
    )