Confused about time expiration
Hi, everyone. Im a little confused about this. The time is correct...however, when it shows the time expiration it is 5 hours behind. Does anyone know what could be the problem? Thanks.
Code Java:
function validateTime(timeStr) {
// Checks if time is in HH:MM:SS AM/PM format.
// The seconds and AM/PM are optional.
if(timeStr == '') return false;
timeStr = timeStr.toUpperCase();
var timePat = /^(\d{1,2}):(\d{2})?(\s?(AM|am|PM|pm))?$/;
var pm_times = 0;
var matchArray = timeStr.match(timePat);
hour = matchArray[1];
minute = matchArray[2];
ampm = matchArray[4];
if (ampm == 'PM' && hour < 12) pm_times = 12 * 3600;
return pm_times + (hour * 3600) + (minute * 60);
}
$(function() {
$('#nav').droppy({speed: 130});
var options1 = {format: '%I:%M:%S %p' }
$('#jclock1').jclock(options1).addClass('ui-state-active ui-corner-all');
$('#timeout').everyTime(5000,function(i) {
var cookiename = 'time_left=';
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ')
c = c.substring(1,c.length);
if (c.indexOf(cookiename) == 0) {
var data = c.substring(cookiename.length,c.length);
data = unescape(data.replace(/\+/,' '));
data = 'Session expires<br/>at ' + data;
}
}
$('#timeout').html(data);
}).addClass('ui-state-error ui-corner-all');
Re: Confused about time expiration
Try asking this on a javascript forum.