strtotime and custom field value

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

Related posts

1 comment

  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

Comments are closed.