Announcement

Collapse
No announcement yet.

Date Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Date Problem

    The following Code:

    dtToday = new Date();


    Yr = dtToday.getFullYear();
    Mo = dtToday.getMonth();
    Da = dtToday.getDate();

    give for dtToday : "Sun July 31 2005"
    Yr and Da are correct, but Mo gives 6 instead of 7 as result.
    What is wrong?

    Traveller

  • #2
    Traveller
    Months are numbered 0-11 (January-December) hence 6 is July.
    See this article in the EFS KnowledgeBase on Date Operations
    Alex

    Comment


    • #3
      Thank You, Alex

      Traveller

      Comment

      Working...
      X