Reputation: 1864
I have date in this format: 2010-01-11. I want to display JAN-11. How can i do this using php?
Upvotes: 1
Views: 170
Reputation: 5381
Rudu's answer is correct, +1.
"M-y" would result to "Jan-11" so if you need the output to be UPPERCASE, dont forget to use strtoupper().
<?php echo strtoupper(date("M-y",strtotime("2010-01-11")));?>
also bookmark this for later reference. http://www.php.net/manual/en/function.date.php
Cheers
Upvotes: 1