A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [CS3] date object question. (9 is Oct )

  1. #1
    Member
    Join Date
    May 2007
    Posts
    44

    Lightbulb [CS3] date object question. (9 is Oct )

    i wanted to create a date object for 2008/SEPTEMBER/19.
    so I wrote the following.

    Code:
    var myTime:Date = new Date(2008,09,19,12,0,0);
    trace(myTime);  // Sun Oct 19 12:00:00 GMT+0300 2008
    as you can see, i prints Oct instead of Sep.
    why is this happening?
    what`s the logic behind date object?

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the parameter for month in the Date constructor is zero based

    0 = Jan
    1 = Feb
    2 = Mar .... and so on....

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center