This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to get the day of the week and month of year

kind sirs.

I must thank you coz you responds my question before but I still don't understand how to do it.

I look carefuloly at Erik Malunds answer.

he says 'for weekday, divide days by 7, the reminder is the weekday' but how do you know what day 0 is. it is not always sinday.

and he says 'for day of month, subtract 4 years till no 4 left' but I do not understand why at all.

is he making a very cl;ever answer or is it goot or is it wrong. we have looked at it and we are all confused.

please help us.

  • it is not always sinday.
    0 = same as your 'base day'

    subtract 4 years till no 4 left'
    4 years at a time takes care of 'leap year arithmetic'

  • Sir.

    Kind Erik say 0 = same as your 'base day' but we know the first day of a month is not always the same sinday.

    and Kind Erik say 4 years at a time takes care of 'leap year arithmetic' but is that right for centurys?

    can you give us some code and explain what you mean./

  • Kind Erik say 0 = same as your 'base day' but we know the first day of a month is not always the same sinday.
    you do not have a clue, do you?

    can you give us some code
    sure, send me your billing information

  • Kind sirs.

    I do not understand. and my coleegs do not understand.

  • Sorry I can't fix that, have you considered other careers?

    We're 3-4 weeks in here, and haven't got answers to some pretty basic question about your system/implementation.

  • You are asking a trivial question.

    It is so trivial, that you - yourself - should be able to answer your question if you bothered to actually think about the problem. After all, it is well known that every single week have seven days.

    Leap years? Every four year is a leap year. Every 100 year is not a leap year. Every 400 year is a leap year. Don't understand what I mean? Don't you understand all the texts you can find on the net about leap years? How much time have you spent trying to figure out the leap year rules?

    So you have a school assignment that your teacher should be within your ability to understand. Are you going to disappoint your teacher? Or are you going to show that you are no dumber than any other of the students?

    By the way - you talk about 60 days, so no need to involve any months and length of months in the problem. Not even a need to involve any year or any leap year. All you need to know is what weekday it is when the user is initially setting the clock. Then it is trivial to step forward Sunday -> Monday -> Tuesday -> Wednesday -> Thursday -> Friday -> Saturday -> Sunday -> Monday -> Tuesday -> ... (starting to get the idea yet?)

    And please, stop creating new threads again, and again, and again, and again asking the same question.