Announcement

Collapse
No announcement yet.

Help gettting data for a specific time period

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

  • Help gettting data for a specific time period

    I would like to get data for a specific time period but I am not sure how to do it.

    For example lets say I wanted the HH and LL for the period of time between Sunday 00:00 to Monday 00:00 and that is it.

    I know how to do HH and LL stuff and every thing else but I'm stuck on the specific time logic.

    Any help is greatly appreciated

    Thanks
    Stephen
    Last edited by whatever; 03-25-2004, 12:45 PM.

  • #2
    Please Help

    Comment


    • #3
      Hello Stephen,

      Assuming you mean from midnight Sunday to midnight Monday, you'll have to use a 24-hour time template and check for the day of the week using a Date object . You could use if (getDay(0) != getDay(-1) to detect the first bar of the day, which may not always be 00:00. At this bar you would then use the Date object from getValue("Time") and check for the day of the week using the getDay() method of the Date object. Don't confuse this with the EFS function getDay(), which returns the day of the month. The Date object's .getDay() method returns a number 0 to 6, 0 being Sunday. Here's a code example of how you'll use this method. Make bMonday a global boolean variable.

      PHP Code:
          if (getDay() != getDay(-1)) { // first bar of day
              
      var vDate getValue("Time");
              var 
      vDayOfWeek vDate.getDay();
              
      debugPrintln("Day of the week: " vDayOfWeek);
              if (
      vDayOfWeek == 1) {  // Mondays
                  
      bMonday true;
              } else {
                  
      bMonday false;
              }
          }
          
          if (
      bMonday == true) {
              
      // do normal HH LL routines
          

      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #4
        Just what I needed.
        Thank you Jason.

        Comment

        Working...
        X