Service Virtualization

  • 1.  To add dates excluding weekends

    Posted May 02, 2017 02:47 AM

    My requirement is to pass dates by adding to the current date to the scripts but it should exclude weekends.Is there any way to add dates excluding weekends



  • 2.  Re: To add dates excluding weekends
    Best Answer

    Broadcom Employee
    Posted May 02, 2017 04:32 AM

    I had this question a few years ago, but when I was then asked "How do we know which days are weekends, not just for where your PC is located, but for your server machine and for all the machines that it communicates with - it could be Thursday & Friday, Friday & Saturday, or Saturday & Sunday, and it could be different for each machine in the stack? The purpose for weekend non-processing would logically include the public holidays for your specific country, so it would need to be aware of every public holiday in every country for every year, too", I realised that it was too-broad a question, and I began to understand why Java has no method for doing this.

     

    With a bit of scripting, and investigation on places like StackOverflow, you should be able to generate something that approximates a trivial subset of the above, but to get anything useful, you would need to query all the machines in your stack to determine what dates they understand as non-processing dates. It would be a lot of work.



  • 3.  Re: To add dates excluding weekends

    Posted May 02, 2017 07:29 PM

    Thanks Rick Brown