Calculate the date _ PHP Tutorial after a specified workday

Source: Internet
Author: User
Calculate the date after the specified business day. This function is used in recent projects to calculate the date after N working days. now we can solve the problem by thinking of the following solutions. This indicates that the workday is still used in the recent project according to the national regulations to calculate the date after N working days. now I think of the following solution to solve the problem.

This indicates that the work days are calculated according to national regulations, that is, from Monday to Friday and before and after the statutory holidays, the work days are counted as work days, and Saturday, Sunday, and statutory holidays are not counted as work days, the statutory day and the date of the shift can be stored in the database for maintenance.

The code is as follows, and the efficiency is not very high. if you have a better solution, please share it with others.

 

Bytes. This indicates that the work day is still in accordance with national regulations...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.