0

After searching still problems with string replace My $date looks like

Sat, 11 Feb 2017 11:33:38 +0100

I need only the date part (YYYY-MM-DD):

2017-02-11

Please can somebody help. Thank you! Best regards, Roman

Roman
  • 115
  • 2
  • 8

2 Answers2

1

Use

date("Y-m-d", strtotime($date)); 

$date is var name that contain like Sat, 11 Feb 2017 11:33:38 +0100

GRESPL Nagpur
  • 1,996
  • 3
  • 18
  • 38
0

use date("Y-M-D", strtotime($date));