문제

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