does ooRexx know what day it is?

Developers
2007-11-05
2012-08-14
  • does ooRexx have a function to return the day of the week for a given date, ie: does it know that "20071109" is "Friday"?

    --Gary

     
    • Rick McGuire
      Rick McGuire
      2007-11-05

      If you're using a release prior to 3.2.0, you can use date('b')//7 to get the day of the week. Monday is 0, tuesday is 1, etc.

      With the 3.2.0 release, there's a new DateTime class that has a method that will give you a numeric day of the week. That method returns 1 for Monday, 2 for Tuesday, etc. to match the ISO date standards.

      Rick

       
    • Lee Peedin
      Lee Peedin
      2007-11-05

      Or to be a bit more specific to Gary's question. :-)

      Yes, Rexx knows that 20071109 is Friday

      say date('w',20071109,'s')

      Lee