Forums ProRealTime English forum ProBuilder support Tomorrow's date Reply To: Tomorrow's date

#94795

OpenDayOfWeek returns:

1=Monday, … 5=Friday, so if any OpenDayOfWeek is within the range 1-5 it’s a business day (unless there’s some local holiday), so you can detect how many business days there are in each month by tallying from day 1 to the last day and skipping those ourside that range.

Anyway, I attach 4 functions (they are actually indicators, but the behaviour is the same as in other languages, they may require parameters as their input and return some data):

  • DayMax                 (input: Month,Year                                                               returns: MaxDay)
  • IsLeapYear          (input: Year                                                                             returns: 1=leap year, 0=no leap year)
  • UnpackDate        (input: Date formatted as YYYYMMDD, as PRT does    returns: Day,Month,Year)
  • GetDayOfWeek  (input: Date formatted as YYYYMMDD, as PRT does    returns: 0=Sunday,1=Monday,….,6=Saturday)

I attach both .ITF files to be imported into ProBuilder as well as .TXT files:

Edit:     The above GetDayOfWeek function does not work fine, it has been replaced by a new version  (see post https://www.prorealcode.com/topic/tomorrows-date/page/2/#post-95272)

 

2 users thanked author for this post.