SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    leap year programme

    i am new to javascript,please give me the leap year programme, i.e. 0 to 2006 which is leap year and what is not

  2. #2
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi sivabarik and welcome to Sitepoint.

    Determining which years are leap years is not difficult in itself, but it depends how you want the results? Do you want a list of all leap years between 0 and 2006? Or do you want to be able to perform a check on a specific year?

    If you give a little more information on how you intend to use the results, I can help build a solution.

    Kind regards,
    Jordan

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want to know which are leap year and not a leap year between 0 A.D. to 2006 AD.

  4. #4
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    list of leap year between 0 to 2006
    Quote Originally Posted by J Windebank
    Hi sivabarik and welcome to Sitepoint.

    Determining which years are leap years is not difficult in itself, but it depends how you want the results? Do you want a list of all leap years between 0 and 2006? Or do you want to be able to perform a check on a specific year?

    If you give a little more information on how you intend to use the results, I can help build a solution.

    Kind regards,
    Jordan

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,834
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The list of leap years between 1582 and 1924 differs depending on which country you you want the list for as different countries switched from the Julian calendar to the gregorian calendar at different times during that period.

    Julian calendar leap year rule:

    if (year % 4 == 0)

    Gregorian calendar leap year rule:

    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)

    The years 1700, 1800, and 1900 were not leap years in countries using the gregorian calendar but were on countries that hadn't swapped yet. An adjustment was also made for 100, 200, 300, 500, 600, 700, 900, 1000, 1100, 1300, 1400, and 1500 to adjust the date as if the Gregorian calendar had always applied.

    An extra leap day is needed by 4882 and every 3300 years after that but that's outside of the date range you are looking at.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks stephen, it works.thanks again


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •