-8

I am getting current date using the function date("Y-m-d"). I want to display date 2017-09-12 as sep 12

BenRoob
  • 1,662
  • 5
  • 22
  • 24
secondsight
  • 115
  • 1
  • 10

3 Answers3

2

You can present it as ("M j"). Here is a test version.

Boian Ivanov
  • 164
  • 1
  • 3
  • 14
0

this will do: date_format($date,"M/d");

Deee
  • 331
  • 2
  • 9
  • 27
0

Here is your date..

$myDate = "2017-09-12";

Then you have to convert your date with Date PHP function

$date = date("M d",mktime("0 0 0 ".$myDate));

echo $date will print Sep 12

d is Day of the month, 2 digits with leading zeros

M is a short textual representation of a month, three letters

Asfandyar Khan
  • 1,677
  • 15
  • 34