Home > Backend Development > PHP Tutorial > How to get the specific date of the working day after the specified date in ThinkPHP (detailed code explanation)

How to get the specific date of the working day after the specified date in ThinkPHP (detailed code explanation)

不言
Release: 2023-04-04 09:56:01
forward
2667 people have browsed it

The content of this article is about how to get the specific date of the working day after the specified date in ThinkPHP (detailed code explanation). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. help.

Idea:

1. Obtain the data array of all working days in the query year
2. Obtain the index of the query start date on the working days
3. Calculate the date to be queried Index
4, get query date

/*创建日期类型记录表格*/
CREATE TABLE `tb_workday` (
`did` int(11) NOT NULL AUTO_INCREMENT,
`exact_date` varchar(32) NOT NULL COMMENT '具体日期:格式date("Ymd");(20170205)',
`date_year` varchar(32) NOT NULL COMMENT '具体日期:格式date("Y");(2017)',
`date_type` tinyint(2) NOT NULL COMMENT '日期类型:0、工作日;1、特殊工作日;2、法定节假日',
PRIMARY KEY (`did`)
) ENGINE=InnoDB AUTO_INCREMENT=829 DEFAULT CHARSET=utf8 COMMENT='各年工作日&法定节假日数据'
Copy after login
rrree

The above is the detailed content of How to get the specific date of the working day after the specified date in ThinkPHP (detailed code explanation). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template