Announcement

Collapse
No announcement yet.

getDay() bug?

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

  • getDay() bug?

    Segment of my code in latest eSignal:
    var first_date = new Date( d.getFullYear(), d.getMonth(), 1 );
    var first_day = d.getDay();
    trace( "First day:"+first_date+"@"+first_day );

    The output:
    Starting at:Wed Sep 10 10:24:33 GMT-0400 (Eastern Standard Time) 2003
    First day:Mon Sep 01 00:00:00 GMT-0400 (Eastern Standard Time) 2003@3

    Should Sep. 1st of 2003 a Monday?
    Also, who says Eastern standard time is GMT-4:00?????

  • #2
    Should Sep. 1st of 2003 a Monday?
    According to my calandar it is.



    Also, who says Eastern standard time is GMT-4:00?????
    Pretty much everyone.
    Garth

    Comment


    • #3
      But Esignal says Sep. 1st of 2003 is Wednesday.

      And Microsoft Windows says EST is GMT - 5.

      Comment


      • #4
        Well, it is really EDT (as it should be) that it is reporting. So you are right that it says EST when it should say EDT...but the offset is correct.

        :Mon Sep 01 00:00:00 GMT-0400 (Eastern Standard Time) 2003@3
        Looks like it says Monday to me...what am I missing.
        Garth

        Comment


        • #5
          var first_day = d.getDay();
          trace( "First day:"+first_date+"@"+first_day );

          output is:
          First day:Mon Sep 01 00:00:00 GMT-0400 (Eastern Standard Time) 2003@3
          ...

          Look at the output after the "@" sign. It prints "3" for the value of first_day. 3=Wdnesday, isn't it?

          Also, my time zone is set to EST. Esignal got the correct time zone, but reports the incorrect offset.

          Comment


          • #6
            Oh God, I just found I have programmed something wrong...

            I call getDay() for current day instead of Sep. 1st.

            I am terribly sorry. getDay() works okay.

            The only problem is the EST time offset.

            Sorry for the confusion, and hope the time offset can be resolved.

            Comment

            Working...
            X