locked
Current Date and Time RRS feed

  • Question

  • I need to put an alert on the screen if the time is between 8 and 5 local user time; Monday through Friday and hopfuly not on a holiday.  Can someone please help me to create this if statement?


    Thanks, Dale

    Friday, May 24, 2013 8:03 PM

Answers

  • you can use this code:

    var currentDate = new Date();
    var hour = currentDate.getHours();
    var day = currentDate.getDay();
    // from 8:00:00 to 16:59:59 Monday to Friday
    if (hour > 7 && hour < 17 && day > 0 && day < 6) {
        alert("working time");
    }


    My blog: www.crmanswers.net

    Friday, May 24, 2013 8:44 PM

All replies