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
  • 131
  • 2
  • 10

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
  • 2,048
  • 3
  • 20
  • 40
0

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