Raj Samani
Raj Samani

Reputation: 87

get and print date from custom fields of custom post type

I have selected a date in the custom field by using a date picker. Now i want to get that date in date formate and print the date separately like day,month and year.

<div class="infocou">

            <div class="tr_co col-xs-12">
              <img src="<?php echo $featured_img_url;?>" id="trian_img">

              <h2><a href="<?php echo $permalink_training; ?>" class="title-training">
              <?php echo $trainingtitle; ?></a></h2>
              <img src="<?php echo get_template_directory_uri().'/assets/images/tran_ico.png';?>">
              <h3><?php echo $training_duration." ".$training_timings;?></h3><br/>
              <h3><?php echo $training_date;?></h3><br/>
              <h4><?php echo $training_type;?></h4>
            </div>
            </div>
        <?php } ?>-->

        <?php

        ?>

    <h6><?php **echo $training_date;(i want to print day of the event date here)** ?><br/><span>Sept</span></h6>
    <div class="infocou">
      <h5>Introduction <br clear="hidden-sm hidden-xs" />To Programming</h5>
      <img src="<?php echo get_template_directory_uri().'/assets/images/cour_icon.png';?>"> <i>8:00 am - 10:00 am</i><br/><br/>
      <img src="<?php echo get_template_directory_uri().'/assets/images/cour_icon2.png';?>"> <i> Paathshaala Campus</i>
    </div>

Upvotes: 0

Views: 66

Answers (1)

Aiyaz Khorajia
Aiyaz Khorajia

Reputation: 598

use echo date('D', strtotime($training_date));

Upvotes: 3

Related Questions