两个日期之间的时间段(自定义)(number of periods (custom) between two dates)
我想了解两个日期之间有多少个时期(自定义)。 比如在7月1日到8月2日之间有多少个星期,或者在2月和12月14日之间有多少个半月,半个月内可以定制,不管是15日还是16日。
有没有任何图书馆这个或类似的东西已经完成? 不是那么棘手,而只是想知道这样的事情是否存在。
I want to find out how many periods (custom) are there between two dates. Like how many weeks are between 1 july to 2nd Aug or how many half months are there between 2 nd Juy and 14 Dec, where in half month would be customizable whether it ends on 15th or 16th.
IS there any library where this or something similar has been done? Not that its tricky but just want to know if such things exists.
原文:https://stackoverflow.com/questions/1031034
更新时间:2023-06-03 20:06
最满意答案
相关问答
更多-
使用mod_rewrite,您可以使用以下规则,现在当您访问http://www.example.biz ,它将显示来自site/的索引文件。 RewriteEngine On RewriteRule ^$ /site/ [L] 或者如果你想显示每个文件尝试下面, RewriteEngine On RewriteRule ^(/|.+)$ site/$1 [L] I found a simpler solution, RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] R ...
-
在你的abc.domain.com/en/.htaccess使用它 RewriteEngine On RewriteBase /en/ RewriteRule ^([0-9]+)/?$ vacancies.php?id=$1 [NC,L,QSA] Use this in your abc.domain.com/en/.htaccess RewriteEngine On RewriteBase /en/ RewriteRule ^([0-9]+)/?$ vacancies.php?id=$1 [NC,L,Q ...
-
无论你问什么,都与在codeigniter中设置动态基本URL有关。 他们已在这里和这里得到了回答。 希望你发现它有用。 Whatever you are asking, has something to do with setting up dynamic base url in codeigniter. They have been answered here and also here. Hope you find it helpfull.
-
Codeigniter App在一个子域中工作,但在另一个子域中不工作。(Codeigniter App works in one subdomain, but not in another. Why?)[2019-12-07]
我解决了我的问题。 我最终进入我们的apache2.conf文件并更改了这个:Options FollowSymLinks AllowOverride None Require all denied AllowOverride None Require all granted Options Indexes Fo ... -
在您的其他规则之上尝试这些规则: RewriteCond %{THE_REQUEST} \s/blog/([^\s]*) [NC] RewriteRule ^ http://blog.domain.com/%1 [L,R=301] RewriteCond %{HTTP_HOST} ^blog\.domain\.com$ RewriteRule !^blog/ blog%{REQUEST_URI} [L,NC] Try these rules on top of your other rules: Rew ...
-
通配符从子域根文件夹重定向到子域子文件夹(Wildcard redirect from subdomain root folder to subdomain subfolder)[2022-03-14]
循环的原因是因为在重定向之后,客户端请求新的URL并且这个新的URL再次被重定向,导致来自客户端的新请求以及再次重定向,等等... 为了避免这种情况,您必须在规则前添加停止条件,例如 RewriteRule ^img/ - [L] 如果请求的URL已经以img/开头,这会导致重写链退出。 另一种方法是首先测试img文件夹中是否存在相应的文件,如果存在,则仅重定向。 RewriteCond /img/$1 -f RewriteRule ^(.*)$ ^img/$1 [R,L] 如果要从任何重写中排除文件夹 ... -
我想我可能已经解决了这个问题。 更改: RewriteRule ^(.*)$ something1/something2/index.php?/$1 [L] 至: RewriteRule ^(.*)$ /something1/something2/index.php?/$1 [L] 我不再收到内部服务器错误。 为了帮助任何人解决这个问题,这里是我的完整的.htaccess文件: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.tx ...
-
你的错误是你有一个流浪; 在你的第二条规则的条件: RewriteCond $1 !^(index\.php|images|robots\.text|css|js); # this is the culprit screwing everything up------------^ 摆脱它,因为有了它,如果你没有这个条件将是真的; 在index.php之后,你没有。 因此它/index.php/index.php永远重写为/index.php/index.php 。 You error is that y ...
-
您可以通过脚本执行此操作。 首先使用最新的 getDateCreated()检索文件,然后使用getUrl()检索URL。 来自文档的两个描述: getDateCreated() 获取创建文件的日期。 getUrl() 获取可用于在Google App中打开文件的网址,例如云端硬盘或文档。 找到有关如何检索云端硬盘文件夹中最新文件的这些帖子: 如何识别Google云端硬盘文件夹中的最新文件 获取Google云端硬盘文件夹中的最新文件 希望这可以帮助。 祝你好运。 You can do so via your ...
-
在/admin/.htaccess有这个规则: RewriteEngine On # block access if HOSTNAME is not starting with admin. RewriteCond %{HTTP_HOST} !^admin\. [NC] RewriteRule ^ - [F] 或者如果你想显示/index.php?template=error404那么 RewriteCond %{HTTP_HOST} !^admin\. [NC] RewriteRule ^ / ...