Comments (4)
Well your problem isn't really a countdown problem, in fact is a problem of JavaScript that will always parse the date according to the user computer date.
Answering your question directly, if work on your server side to handle the timezone correctly and send to the script the milliseconds to the UTC you can manage this issue, but if the user change his machine date if could lead to a mismatch, but look, you CAN'T avoid-it.
But you could actually validate if the user machine date is the same from the server comparing the the milliseconds to the UTC, and give a warning or do any kind of calculation.
If you think about your problem and see that have some place for improvement of the script just let me know, ok?
from jquery.countdown.
Thank you for the quick reply
Indeed, I know and understand the issue as JS is client side.
Changing user time is beyond any control, but the ability to define (NOW) and use php to place the unix timestamp would be useful.
I cannot see anything n the documentation to define "now" in unix form.
Having a
setNow: "VALUE" ,
that overrides the JS default from within the script would be very handy.
from jquery.countdown.
Today I was thinking about your proposal, and notice that is impossible to implement it. Lets talk about history...
In a earlier version of the script I used to calculate seconds span of from the start to end date at the script initialisation, after that a 1 second interval was started.
This implementation caused a bug that hangup the script 2 second earlier (see issue #10) hence you could start the countdown 0.3 sec (or 300 ms) to finishes and still the script would wait 1 second to update it's status, this delay is unacceptable in certain cases like an auction site.
So the algorithm changed to work on a precision range that can be adjustable, and prevent at best some of this cases.
This version uses new Date()
to get the current machine time, and recalculate the interval of the script (see line 167 of src), and this is needed in order to know when the time changed, setting a fixed setNow
wouldn't add any precision and would lead back to the issue mentioned above.
from jquery.countdown.
Can’t you just pass something like the following as the target date parameter?
new Date(Date.UTC(2014, 4, 19, 11, 0, 0))
from jquery.countdown.
Related Issues (20)
- Found Vulnerability - Need Update
- Web page css error
- How set start/end date? HOT 1
- Change Language
- Countdown as a progress bar HOT 1
- Timezone problem
- How to reset the counter when it reaches zero? HOT 1
- Count just business hours
- dutch language HOT 1
- Is epoch supported? HOT 1
- Redirect the page after count down 0
- vue
- Having trouble using woth foreach loop in php HOT 1
- Restart Time after completing Five Days
- Complicated callback..
- Days counter is not working properly HOT 1
- 'Uncaught TypeError: $(...).countdown is not a function' - may be correct!
- Countdown between business hours and excluding weekends and holidays
- Timer interval do not stop after finish.countdown
- Timer pause/resume or stop/start as well as remove are not working properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.countdown.