I have a custom field of Due and am trying to display the date. It is stored as 20131209. I am using

<?php echo date_i18n( get_option( 'date_format' ), strtotime( $Due ) ); ?>

but it just throws out December 1, 2013

1 Answer 1


The following works correctly for me, returning "December 9, 2013" in my case.

$Due = '20131209';
echo date_i18n( get_option( 'date_format' ), strtotime( $Due ) ); 

So either ...

  1. $Due is not what you think it is
  2. Or you have set a custom date format to an incorrect value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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