简体   繁体   中英

Date Format can change when Getting values from database

in daytabase date format is -> 2013-12-12 11:06:07

i want to change in this format by geting value from database -> Thu Nov-28-13 10:02:56

<div class="time_lft_con">
     Time Left:  <span><!--3h 3m--></span> <!--(Thu Nov-28-13 10:02:56 EST)-->( <?php $get_date=$row['end_date']; ?> EST )
     <p>
       <a href="#">
          <img src="images/paypal_card_img.png" alt="" >
       </a>
     </p>
</div>
<?php echo date_format($get_date, 'Y-m-d H:i(worry)'); ?>

Use DateTime in php

 <?php
    $date1="2013-12-12 11:06:07";
    $date = new DateTime($date1);
    echo $date->format('D M -d-y H:i:s');

Not sure what your question is, you should add some details. For what I understand you're looking for something like this :

<?php echo date_format($get_date, 'D M-d-y H:i:s'); ?>

You can find documentation here : http://fr.php.net/manual/en/datetime.format.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM