Hi,
I copied this algorithm from someone else’s post. But for some reason I am getting Monday when it’s actually Thursday now (here in Sydney, Australia). Can any of you geniuses help me out here?
Any help will be appreciated.
What are u trying to get? Today’s day?
Yes. I was trying to get today’s day.
Thank you so much !!
Sorry, I’ve re-opened this question. The simpler solution above doesn’t give me the right day most of the time.
whats not working? or rather how is it not working?
For example, today (Feb 6, 2018) is day 37. So, it gives me a result of 5 (37 - 1 / 7 = 5), which is Friday (or Option 4)
thats not a divide symbol its a modulus (%). a modulus gives the remainder of a division. so it would actually be 37-1 = 36, 36/7= 5, 7*5 = 35, 36-35=1 (36%7=1) on equal tuesday which is what it is on your side of the world. its a lot easier to explain on paper but just imagine doing long division a modulus does the division and only returns the remainder.
Oops. Yeah, I had the divide symbol instead of the modulus symbol.
Yeah, that’s clear to me now.
Thank you.
you may actually need to modify that though since it will only work for this year. next year it will need to subtract 2 since the year 2019 starts on a tuesday. thats one of the reason all computer clocks have a base date or at least they did once upon a time.