finding # of days in a month


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: finding # of days in a month

  1. #1
    rich Guest

    finding # of days in a month


    is there a method or function to determine the # of days for a given month
    and a given year? thanks in advance.

  2. #2
    D. Patrick Hoerter Guest

    Re: finding # of days in a month

    rich,

    I don't know your language of choice, but:

    Convert your month and year to a form like MM/01/YYYY, then add 1 month,
    and get the difference in terms of days.

    Example:
    Given 10 for month, and 2000 for year, take 10/01/2000, and add one
    month, using whatever date mathematics you have available. Next, subtract
    the dates from each other to return number of days. This can normally be
    reduced to one statement.

    Regards,
    D. Patrick Hoerter
    rich <rperez@teleteam.net> wrote in message news:39b69895$1@news.devx.com...
    >
    > is there a method or function to determine the # of days for a given month
    > and a given year? thanks in advance.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center