Announcement

Collapse
No announcement yet.

getting day of week(Monay, Tues, )

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

  • getting day of week(Monay, Tues, )

    I want to get the day of the week(ie. Sunday = 0, Monday =1)

    According to the literature it should be 'getDay()'...but now that returns day of the month (1-31)

    It seems this has changed recently?

    Can anyone help

  • #2
    sydney7777az
    getDay() returns the day of the week only when used as a method of the Date Object
    Enclosed below are two examples on how to use the getDay() method to retrieve the day of the week based on bar time or system time
    Alex

    PHP Code:
    function main(){

        
    //Date object using bar time
        
    var BarTime getValue("Time");
        var 
    BarDOW BarTime.getDay();
        
    //Date object using computer time
        
    var SystemTime = new Date();
        var 
    SystemDOW SystemTime.getDay();
        
        
    debugPrintln("Today is  "+BarDOW+"  "+SystemDOW);

    Comment

    Working...
    X