In ECMA compliant implementations, months are identified by an integer in the range 0 to 11, inclusive.
The month number is calculated by taking the number of the day at the target time and then taking the day number at the start of that year. The difference is the day number within the year, which can then be used via a compare and lookup mechanism to deduce the month. The InLeapYear() method comes into play to offset the day number by one when it is a leap year.
See also: | Day number, Day within year, Month from time, Time range |
Prev | Home | Next |
Month from time | Up | MotionBlur() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |