-2

I have this php script

date('dS F Y', strtotime($dateVariable))

The result is this:

01st September 2014

but I need the result as this: 01st Sep 2014

in other words, I need not the full name of the month. is that possible please?

Anastasie Laurent
  • 877
  • 2
  • 14
  • 26

3 Answers3

2
date('dS M Y', strtotime($dateVariable))
XaxD
  • 1,429
  • 14
  • 27
2

Try as below

date('dS M Y', strtotime($dateVariable))
narendra
  • 1,278
  • 1
  • 7
  • 8
1

You can do it directly with the date function, using the 'M' mode.

http://php.net/manual/en/function.date.php

Alternatively, check out the function JDMonthName -- using mode 2 you can get the abbreviated month name.

http://php.net/manual/en/function.jdmonthname.php

Alternatively, check out the strftime function (much like printf) for formatting your date. The %b format gives the abbreviated month name.

http://php.net/manual/en/function.strftime.php

lowcrawler
  • 6,777
  • 9
  • 37
  • 79