brunodd
brunodd

Reputation: 2584

PHP Abbreviated month name

I am trying to use dates with abbreviated months in php. I've already tried d ([.\t-])* m Y found on their documentation but what I am getting is this 20 ([. -])* 01 2016

How can I use abbreviated months like 10 Jan 2016 in PHP?

Upvotes: 8

Views: 9451

Answers (3)

pradip katare
pradip katare

Reputation: 9

Just use the substring function:

substr($month,0,3);

Upvotes: -1

afrolo16
afrolo16

Reputation: 13

Here's I found it, even thought it's really late but maybe someone needs it basic

date('M',strtotime($dateValue))

https://www.w3resource.com/php/function-reference/date.php

Upvotes: 1

rjdown
rjdown

Reputation: 9227

Today's answer was brought to you by the letter M (capital) and a link to the docs http://php.net/manual/en/function.date.php

Upvotes: 13

Related Questions