I am getting current date using the function date("Y-m-d")
.
I want to display date 2017-09-12
as sep 12
Asked
Active
Viewed 1,048 times
-8

BenRoob
- 1,662
- 5
- 22
- 24

secondsight
- 115
- 1
- 10
-
2http://php.net/manual/it/function.date.php – ScaisEdge Sep 12 '17 at 06:42
-
1http://php.net/manual/en/function.date.php there is "M" for a 3 letter abbreviation for month. – BenRoob Sep 12 '17 at 06:42
-
3have you tried anything ? – Minar Mnr Sep 12 '17 at 06:43
-
2You are not tried anything and where is your code? – Anand Pandey Sep 12 '17 at 06:50
3 Answers
2
You can present it as ("M j"). Here is a test version.

Boian Ivanov
- 164
- 1
- 3
- 14
-
-
1If you want to transform it to lowercase, just use strtolower(). Here's an example : https://3v4l.org/kn1lM – Boian Ivanov Sep 12 '17 at 06:50
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