I'm trying to get the date of the first week in 2015 and its really frustrating.

This works:

strtotime("2014W17-1")

it returns 2014-04-27

But when I call:

strtotime("2015W1-1")

it returns 1970-01-01

Hmm. Whats wrong ?

Thanks!

有帮助吗?

解决方案

I have been stupid!

Easy fix:

echo date("d/m/Y", strtotime("2015W01"));

Or if looking at your code, just add a 0.

echo date("d/my/Y", strtotime("2015W01-1"));
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top