Foxpro Foxpro -5 years ago 301
jQuery Question

How to set a countdown timer with a start date to an end date?

I'm using a countdown plugin but I want to create a future countdown start date > end date. For example if now [

2015/05/16 00:00:00
] I want to create start date [
2015/06/16 00:00:00
] to end date [
2015/07/16 00:00:00
] to show
content and also hide other
content before start date and after end date.

Also searched another plugins :





Answer Source

This Code would only start the countdown when the actual day is between the start- and enddate and will work for the jQuery countdown.

<div id="element"></div>
<script type="text/javascript">
    var startdate = "2015/06/16",
        enddate = "2015/07/16";
    if(new Date() >= new Date(startdate) && new Date() <= new Date(enddate)) {
        .countdown(enddate, function(event) {
                event.strftime('%D days %H:%M:%S')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download