Is there any way we could have an option to count down by interval, meaning instead of counting down to 2008-02-17T08:00:00-02:00 count down 129600 seconds.

This would make Automated Logout more accurate when the users computer clock and the servers clock are not in sync.

Thanks

Comments

jvandervort’s picture

Not sure how you'd want that implemented. We save the timer start date/time in the node/block directly,
so if we used a interval or duration, every time you reloaded the page you'd start at 129600 seconds again
(and again, and again...)

jrglasgow’s picture

What would be the point, with the automated logout module every time you load the page you want the timer to start again, say your timeout before logging off is 1 hour, every time you load the page you want the timer to start with 1 hour.

With my test server testing automated logout I noticed that the timer would start and get down to 30 seconds left and the page would refresh, which should have happened about 40 seconds later according to the timer, but the system clocks on the server and the client machine weren't in sync, something you can't always guarantee. I would consider this fine when just counting down to a date in the future, but when you are counting down to an event that will be happening on the client and the date-time was determined by the server.

The method of reloading the page is with "" a meta tag, unfortunately the meta tag does not support giving it a date-time, just a delay in seconds, if I could put a date-time code in the meta tag it would be the easiest way to proceed.

I hope I have been able to make reasoning clear.

jvandervort’s picture

Yes, time sync between the server and the client is a problem.

We could:
Pad the countdown timer so it is worse case (say have the countdown timer be 60 seconds ahead of the server),
or perhaps send the now() time from the server to the client (with latency problems from the internet).

There is no 'exact' fix for this, since the server controls the logout.

jvandervort’s picture

Assigned: Unassigned » jvandervort
Status: Active » Closed (fixed)

Added support for server time-sync in the DRUPAL-6.x-2.4 version.
This should get us closer. I don't know how much better we can get.

Umayal’s picture

Project: Javascript Countdown Timer » Date
Version: 6.x-2.1 » 7.x-2.5
Component: Code » Date Field
Assigned: jvandervort » Umayal

How to count the days between date and time

I am using following code , but days not caluculated
I get the value of start and end date buy $diff cannot return any value.
If I use hours, It count the hours.

$start = new DateTime($st->field_fdt_period_timing['und'][0]['value']);
$end = new DateTime($st->field_fdt_period_timing['und'][0]['value2']);
$diff = $end->diff($start);
$a=$diff->days;
dpm($a);

I use D7.12
above code is right otherwise It need any change?
pls help me.

jvandervort’s picture

Project: Date » Javascript Countdown Timer
Version: 7.x-2.5 » 6.x-2.1
Component: Date Field » Code
Assigned: Umayal » Unassigned

@umayal,
Issue tracker is closed for the countdown timer.