-2

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!

pts
  • 80,836
  • 20
  • 110
  • 183
Thomas Bolander
  • 3,892
  • 3
  • 22
  • 30

1 Answers1

1

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"));
Albzi
  • 15,431
  • 6
  • 46
  • 63