Calculate the day of the week for the first day of a given month

How can I calculate if the current month began on a Mon, Tue, etc?

That is, I’m somewhere in the middle of March 2025 and I want to find out that the first day of March this year was a Saturday.

2 Likes

Interesting . I think it might involve checking if it is a leap year . You need to find out the day of the week at the beginning of the year then count forward . I am sorry I am interested but not sure I can help . I have formulas for counting down to certain dates .

1 Like

Not sure either, haven’t looked into this.
There are creators like @Zieneth that display whole calendars. Check this inspectable face, maybe that gets you going…:

2 Likes

This will return number from 0-6 representing starting day of current month (Sunday being the 0):
((7-(#Dd#+6-#DOW#)%7)%7)
Maybe it can be simplified, but I cant think straight anymore tonight.

3 Likes

I was approaching that on a test face with trial and error. I knew I needed 2 modulo 7s in there. Thanks for saving me the rest of the brain ache.
Pretty certain that’s as good as it gets. No extraneous brackets, can be dropped into any ternary conditional expression.

1 Like

As such things go that’s pretty straight forward and compact. I must try this immediately.

For way too much stuff in a calculation check this out:

$#DISDAYTIME#=true&&((#DH#*3600)+(#Dm#*60))>=((#WRH#*3600)+(#WRm#*60))&&((#DH#*3600)+(#Dm#*60))<=(((#WRH#*3600)+(#WRm#*60))+((((#WSH#*3600)+(#WSm#*60)-(#WRH#*3600)-(#WRm#*60)))/12))?100:0$

That’s to determine whether to display I for the first hour of daylight where hours are of a length of one twelfth the time between sun up and sundown. It’s for this goofy watch, which seemed to be correct mostly except for around midnight when things go wrong.

Thanks.

2 Likes

Yeah, The midnight crossover is a pain when doing SS to SR. Other way no problem for most of the world…
I really want to try and reduce that but you seem to have a handle on the maths so I may well not be able to.
I have an on/off for next SR/SS on a rotary 12h dial:

Also, calculation of percentage SS-SR and vice versa

I would love to hear improvements I can make to either.

1 Like

You might be interested in this thing then. Seems to work OK for the limited testing I did on my test watch. Have to check it on a watch since Creator doesn’t have a variable setting for SR-SS, although I could put in hard times for those as a check.

It started with a one hand watch this guy on Reddit asked for. I answered because the watch he showed was from the same company I bought a French Revolution time watch from. Don’t know if he ever looked let alone loaded it on a watch. russellcresser told me to make the sunrise-sunset black and white area active instead of what the real mechanical watch does which is just show half black and half white.

2 Likes

@russellcresser is a star.
I often do the maths, and he the pretty and corrects my maths scale where needed.
We argue on the amount of required parentheses.

In the end though, if it works, it works.

I did the sun line on request from him for correct calculation on another he was working on that was more text based.

1 Like

That nice little formula seems to do the trick. Thanks for the help.

Here’s what it looks like:

4 Likes

Looking good.

1 Like

I am currently on mobile, but I am seriously interested! Is this open for inspection? Looks like it works :slight_smile:

3 Likes

It’s posted and open for inspection. The only really tricky bit was the formula for first day of the week which I could not figure out. Shows how often I do anything with modulo type math.

The extra days on some months was bothering me for some reason so I put in dots to cover dates at the end of 28-30 type months.

The first one I did works OK mostly, but I had several different see through weekend windows. With the magic formula all I needed was one that I rotate.

Here’s the other one

2 Likes

In case you’re wondering, the four black dots on the bottom are to make the number of sections a multiple of 7 ( 35 ) or so it seems to me that’s why they are there. The mechanical version has a rotating color wheel under the date number cut-outs. That watch also has something like 300-400 parts.

2 Likes

Seems to work great for me, I tried Feb for a normal year and leap year :slight_smile:

1 Like

Appreciate the testing. I thought v2, the blue one, was OK because I went through all the months for a couple years. What I didn’t do was click off the “1” to see how the rest of a month looked. Turns out months starting with a Sunday looked correct on Sunday and then went bad.

Fixed that. Looks like I copied an older day check and rotation formula for Sundays and didn’t notice.

1 Like

Yeah, the ‘copy/paste, get lost in the new pretty, go back, test everything but the original you knew worked, forgetting the bit you started with’ thing…