Published in: ASP
URL: http://reusablecode.blogspot.com
Returns the number of days in a given month for a given year. Requires my isLeapYear() function available here: http://snipplr.com/view/5388/check-if-a-year-is-a-leap-year/
<% ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved. ' ' This work is licensed under the Creative Commons Attribution License. To view ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California ' 94305, USA. ' Returns the number of days in a given month (and in the case of February, for the given year). ' REQUIRES: isLeapYear() function MonthDays(someMonth, someYear) select case someMonth case 1, 3, 5, 7, 8, 10, 12 MonthDays = 31 case 4, 6, 9, 11 MonthDays = 30 case 2 if isLeapYear(someYear) then MonthDays = 29 else MonthDays = 28 end if end select end function %>
You need to login to post a comment.
