Jump to content

Format Date Not Working


KateMacwil

Recommended Posts

Hi

I am would like to display the date as "Jan. 3, 2018" (example).
I have tried a few variations of trying to format my date field to the above and nothing is wokring for me.

		<?php
		$sEventDate = get_post_meta (get_the_ID(), "meta-text2", true);
   			
		if ($sEventDate)
		{
		     echo "<div style=font-size: 14px;'>Event Date: $sEventDate</div>";
		}
		else
		{
		     echo "<div style=font-size: 14px;'>Event Date: --</div>";
		}
		?>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...