Countdown using date and time field?

Support General Countdown using date and time field?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10135
    alishaalisha
    Participant

    Hello,
    Is it possible to show how many days and minutes remaining from the match date and time?
    <?php $date = rwmb_meta( 'pb_match_date','', $post->ID);
    $match_time = rwmb_meta( 'pb_match_time', '', get_the_ID() ); ?>
    Regards,

    #10142
    davidrknowlesdavidrknowles
    Participant

    The hard part of this is getting the users time, and this could depend on timezone, DST etc.

    The only way I have found this possible is using JS to get browser information and then compare it with the server output. You will have to pass the server output to the DOM or use AJAX to make the communication with the server.

    Bit of a challenge, I was doing this for a listing site for displaying opening hours and notifying the users if the business was open, I have put it on the back burner for now.

    #10149
    Anh TranAnh Tran
    Keymaster

    Thanks David for your help. I guess Alisha already have start date and end date and just need to calculate the difference between them. I think this thread on Stack Overflow can answer this quite well:

    https://stackoverflow.com/q/676824

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.