• Resolved ytian03

    (@ytian03)


    Hi,

    I am having a problem converting integers to time. I am getting the right data but when I am trying to convert it I get an error or a different date.

    Here’s my code:
    case ‘_date_printed’ :
    $platform = get_post_meta( $post_id, ‘_date_printed’, true );
    //$output = strtotime($platform);
    if( empty($platform)) $platform = ”;
    echo ‘<span>’.$platform.'</span>’; // display the data
    break;

    And this is the output:

    And when I try to convert it to time:

    case ‘_date_printed’ :
    $platform = get_post_meta( $post_id, ‘_date_printed’, true );
    $output = strtotime($platform);
    if( empty($output )) $output = ”;
    echo ‘<span>’.$output .'</span>’; // display the data
    break;

    Here’s the output:

  • The topic ‘Convert int to time’ is closed to new replies.