Question

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!

Was it helpful?

Solution

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"));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top