简体   繁体   English

根据给定的星期数计算第一天的日期

[英]Calculating first day Date of a week from a given week number

I have a question and can't find that specific answer. 我有一个问题,找不到具体的答案。 In my application, my work year start on july 1 every years. 在我的申请中,我的工作年度从每年的7月1日开始。 So 52 weeks later, I start again on july first. 所以52周后,我再次从7月开始。 What I want is a field that I enter let say week 32. I want to have the answer of what is the first day of that specified week and show it as date format. 我想要的是一个输入的字段,假设是第32周。我想知道指定星期几的第一天是什么,并将其显示为日期格式。 So in other words, if I put week 1 in the field, it will give me the result = July 1 and if I put Week 2 in the field, it will gives me july 8, etc. But I think that every year could change. 因此,换句话说,如果我将第1周放到该字段中,它将得到的结果= 7月1日;如果我将第2周放到该字段中,它将给我7月8日,依此类推。但是我认为每年都有可能改变。 So I need a calculation that will do this. 所以我需要进行计算。 Is it possible in php? 有可能在php中吗? Tks for help Seby 谢谢塞比

strtotime("July 1 2013 +".$monthNum." months");

这样的东西?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM