Announcement

Collapse
No announcement yet.

Help with getDay(0)

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

  • Help with getDay(0)

    I would imagine this is a simple request, and possibly that I'm missing something.

    In EFS I need to return the day of the week (0 - 6) for the current bar. According to the documentation as I read it the getDay(0) function should achieve this. What I am getting on return is the day of the month.

    Thank you for your help,
    ...

  • #2
    Isis,

    Get the rawtime (number of seconds since 1970, or something like that) for the last bar, create a JavaScript Date object using it, and use the Date.getDay() member function. For example:
    PHP Code:
    function main() {
        var 
    rawtime_0 rawtime (0);
        
    // rawtime is in seconds, JavaScript Date is in milliseconds
        
    var date_0 = new Date (rawtime_0 1000);
        var 
    nDayOfWeek date_0.getDay();
        
    debugPrintln ("date_0 = " date_0 ", nDayOfWeek = " nDayOfWeek);

    Comment

    Working...
    X