Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. A simple algorithm request

A simple algorithm request

Scheduled Pinned Locked Moved Algorithms
algorithmsquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael J Eber
    wrote on last edited by
    #1

    Does anyone have an algorithm that avoids a month table which computes the last day in a month?

    A D L 3 Replies Last reply
    0
    • M Michael J Eber

      Does anyone have an algorithm that avoids a month table which computes the last day in a month?

      A Offline
      A Offline
      Amar Chaudhary
      wrote on last edited by
      #2

      convert to date (1- x+1 - year); // where x is the month number - obviously you need to take care of December. reduce 1 day from it. Hope it helps :)

      It is Good to be Important but! it is more Important to be Good

      1 Reply Last reply
      0
      • M Michael J Eber

        Does anyone have an algorithm that avoids a month table which computes the last day in a month?

        D Offline
        D Offline
        Dr Walt Fair PE
        wrote on last edited by
        #3

        I'd get the 1st day of the month after the one you're interested in, then subtract 1 day.

        CQ de W5ALT

        Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

        1 Reply Last reply
        0
        • M Michael J Eber

          Does anyone have an algorithm that avoids a month table which computes the last day in a month?

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          My date/time compendium[^] holds that and much more. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


          Getting an article published on CodeProject now is hard and not sufficiently rewarded.


          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups