周数打印日期
大家好。
如果我有第 42 周,并且我需要知道本周有哪些日期,Sombardy maby 能否告诉我获取此信息的简单方法?
坦克很多:)
Hallo all.
if i have week number 42 and i need to know what dates there are in this week, can sombardy maby tell me a easy way to get this info?
tanks a lot :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
哪些输出
您可以修改
,例如第 1-9 周的“周”必须用零填充
Which outputs
and you can modify it like
Week has to be zero padded for weeks 1-9
有一个讨论如何获取本周的第一个日期 (星期一)使用一年中的星期和年份。那应该对你有帮助。
There is a thread discussing how to get the first date of the week (Monday) using the week of the year and the year. That should help you.
我知道您已经接受了答案,但我觉得这段代码也很有用。
这将返回一个 unix 时间戳,有些人发现它更容易操作。
您还可以将其用于 PHP 5.1 及更高版本。
使用上面的方法就可以轻松格式化了。
希望这对某人有用。
-马修
I know you have already accepted an answer, but I feel this bit of code is also useful.
This will return a unix timestamp which some people find easier to manipulate.
You can also use this for PHP 5.1 and higher.
Using the above method you can easily format it.
Hope this provides useful to someone.
-Mathew