/    Sign up×
Community /Pin to ProfileBookmark

Help a countdown timer, Please ?

Hello Forum

Coding is not my profession, But, Now I am in a situation where I have to fix something, and I hope you could help me out.

We have an old factory internal site that is running on some technology which I don’t know, However, All I want to do is to display simple, basic, and fixed countdown timer onto one of its pages. Here is what I have tried:

1) There are some ready countdown timer where I set my event’s date, and it generates nice some tags that I could embed into my page as iframe or whatever. The problem with 99.9999 of these free countdown timers is that they will ALWAYS add their logos and/or links to their own sites. So, My manager ordered me NOT to use those.

2) I have been doing some research, and I found some good blogs e.g. ([url]http://countdownjs.org/[/url]), But, For some reason, I am unable to get to work and nothing is showing up even with simple html page. Here is what I did:

<html>
<head> <title>Coming Soon…!</title></head>
</body>
<link rel=’stylesheet’ href=’https://cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.8/flipclock.min.css‘ />

<style>
#clock {
width: 640px;
margin: 0 auto;
}
</style>
<div id=”clock”></div>
<script type=”text/javascript” src=”//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js”></script>
<script type=”text/javascript” src=”//cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.8/flipclock.min.js”></script>
<script type=”text/javascript”>

$(‘#clock’).FlipClock(getCountDownTime(‘2016-05-28 07:00’), {
clockFace: ‘DailyCounter’,
countdown: true
});

function getCountDownTime(eventDate) {
var date = new Date(eventDate);
var now = new Date();
var diff = (date.getTime() / 1000) – (now.getTime() / 1000);
return diff;
}
</script>

<h1> Our event will start in: </h1> <br />

<h2> Here is exactly where I wish to show the countdown timer !!! </h2>

</body>
</html>

So, Could you please help me to display a very basic running countdown timer?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Kevin2May 24.2016 — See if this works for you:
[code=html]<!DOCTYPE html>
<html>
<head> <title>Coming Soon...!</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.8/flipclock.min.css' />

<style>
#clock {
width: 640px;
margin: 0 auto;
}
</style>
</head>
</body>

<h1> Our event will start in: </h1>
<div id="clock"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.8/flipclock.min.js"></script>
<script type="text/javascript">

$('#clock').FlipClock(getCountDownTime('2016-05-28 07:00'), {
clockFace: 'DailyCounter',
countdown: true
});

function getCountDownTime(eventDate) {
var date = new Date(eventDate);
var now = new Date();
var diff = (date.getTime() / 1000) - (now.getTime() / 1000);
return diff;
}
</script>

</body>
</html>[/code]
Copy linkTweet thisAlerts:
@mary2016authorMay 24.2016 — Thank you Kevin2 - It works perfectly !
Copy linkTweet thisAlerts:
@Kevin2May 24.2016 — You're very welcome. Good luck!
×

Success!

Help @mary2016 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...