
Deleting expired dates
Started by
paieye
, Jul 25 2008 12:16 AM
2 replies to this topic
#1
Posted 25 July 2008 - 12:16 AM
Register to Remove
#2
Posted 17 February 2009 - 04:57 PM
as the file is a text file using a bit of code find todays date. then any text line date < todays date do not display or delete the number of lines till the next text line date
<html>
<body>
<script type="text/javascript">
document.write(Date());
</script>
</body>
</html>
---------------------------------------------------------------------- Date() ---------------------------------------------------------------
And in the following example we set a Date object to be 7 days into the future:
var myDate=new Date();
myDate.setDate(myDate.getDate()+7);
--------------------------------------------display time----------------------------------------------------------
<html>
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>
</head>
<body onload="startTime()">
<div id="txt"></div>
</body>
</html>
---------------------------------------------------------------------------------------------------------------------------------------------------
convert date() to a string or convert text date to a date then compare
hope this helps david
I am in the U.K.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users