I want to get date format

<?php $DeliverBy = $_product->getData('productlength'); ?>
<?php $i=$DeliverBy;
echo  date("d-m-Y",mktime(0,0,0,date('m'),date('d')+$i,date('Y')));?>

In this i add current date + same date based on attribute productlength is a textbox attribute it have some number. So the out put is current date + productlength

it's working fine. It display 12.12.2015

But I want to **12. Dec.2015**


Try this :

<?php $i=$DeliverBy;
    echo  date("d.M.Y",mktime(0,0,0,date('m'),date('d')+$i,date('Y')));?>
| improve this answer | |
  • what is the different beyween m & M – Magento 2 Nov 26 '15 at 10:39
  • m Numeric representation of a month, with leading zeros 01 through 12, M A short textual representation of a month, three letters Jan through Dec & n Numeric representation of a month, without leading zeros 1 through 12 – Abdul Nov 26 '15 at 11:25
  • ok thanks for your answer and explanation – Magento 2 Nov 26 '15 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.