Skip to content
Discussion options

You must be logged in to vote

If You mean current date field from $GPRMC

then:
( “Doomsday Algorithm.”)

def weekday(y, m, d):          
        
	t = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]
	y -= m < 3
	return (y + int(y/4) - int(y/100) + int(y/400) + t[m-1] + d) % 7

will return day no: 0 (Sunday) ,1 (Monday) ....
, for example :

wekday(23, 5, 30)   
    wekday(2023, 5, 30)  

will return value 2 (i.e Tuesday)
note that y = 23 (2023) , whole year y=2023 will also work

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@divergentti
Comment options

@2dof
Comment options

@divergentti
Comment options

@2dof
Comment options

Answer selected by divergentti
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
2 participants