Announcement

Collapse
No announcement yet.

Confusion regarding date processes

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

  • Confusion regarding date processes

    The following code:
    function getBarDayOfWeek(iBar) {
    var dDate = new Date (rawtime(iBar)*1000);
    debugPrintln (dDate.getMonth() + "/" + dDate.getDate() + "/" + dDate.getFullYear());
    return dDate.getDay();
    }

    generates "10/17/2010" on today's bars. Why is the month off by 1?

    Also, dDate.getYear() returns 110? is this really the years since 1900 instead of 1970 as documented?

  • #2
    Re: Confusion regarding date processes

    MBender

    Why is the month off by 1?
    See this post in reply to the same question

    Also, dDate.getYear() returns 110?
    In the same thread linked above see my last post for an explanation
    Alex


    Originally posted by MBender
    The following code:
    function getBarDayOfWeek(iBar) {
    var dDate = new Date (rawtime(iBar)*1000);
    debugPrintln (dDate.getMonth() + "/" + dDate.getDate() + "/" + dDate.getFullYear());
    return dDate.getDay();
    }

    generates "10/17/2010" on today's bars. Why is the month off by 1?

    Also, dDate.getYear() returns 110? is this really the years since 1900 instead of 1970 as documented?

    Comment

    Working...
    X