Support

Account

Home Forums General Issues datepicker on Variables

Solved

datepicker on Variables

  • first I apologize for the wrong title and my bad english, so how can i use the datepicker in my code? i want to use the value from date picker to $date_expire.

    my code :

    
    <?php 
    
    $date_expire = '2018-08-12'; //how to change this to be value from datepicker     
    $date = new DateTime($date_expire);
    $now = new DateTime();
    
    echo $date->diff($now)->format("%d days left");
    
    //for display "%d days, %h hours and %i minuts
    ?>
    

    when i change :

    $date_expire = '2018-08-12'; to $date_expire = the_field('date');

    it’s not working

    thank’s

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘datepicker on Variables’ is closed to new replies.