Skip to main content
1 de 3
Patrick
  • 350
  • 1
  • 11

Creo que esto con javascript te funcionaria

<div id="countdown"></div>
<script>
var end = new DateTime('2019-03-28'); //Fecha de fin

    var _second = 1000;
    var _minute = _second * 60;
    var _hour = _minute * 60;
    var _day = _hour * 24;
    var timer;

    function showRemaining() {
        var now = new DateTime('2019-03-10'); //Fecha de inicio
        var distance = end - now;
        if (distance < 0) {

            clearInterval(timer);
            document.getElementById('countdown').innerHTML = 'EXPIRED!';

            return;
        }
        var days = Math.floor(distance / _day);
        var hours = Math.floor((distance % _day) / _hour);
        var minutes = Math.floor((distance % _hour) / _minute);
        var seconds = Math.floor((distance % _minute) / _second);

        document.getElementById('countdown').innerHTML = days + ' dias, ';
    }

    timer = setInterval(showRemaining, 1000);
</script>
Patrick
  • 350
  • 1
  • 11