![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
26/03/2002, 06:49
|
| | Fecha de Ingreso: marzo-2002
Mensajes: 46
Antigüedad: 22 años, 10 meses Puntos: 0 | |
Re: Trabajando con TIEMPO y Listas Desplegables ..te he hecho esto, espero que puedas adaptarlo a tus necesidades...lo del literal del dia, no he sabido hacerlo..bye
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script>
function ver(){
//////////////////////////////////////////////////////////////////////////////////////
// EXTRAE LOS MESES QUE RESTAN DE AÑO
//////////////////////////////////////////////////////////////////////////////////////
d = new Date();
tmp = (d.getMonth() + 1) //extrae el mes actual
for (i=tmp;i<=12;i++){
document.write ("MES="+i+"<BR>")
}
////////////////////////////////////////////////////////////////////
// EXTRAE LOS DIAS QUE RESTAN DEL MES
////////////////////////////////////////////////////////////////////
d = new Date();
d2 = new Date();
tmpMes = d.getMonth() + 1 //extrae el mes actual
tmpDia = d.getDate() //extrae el dia actual
nuevodia = tmpDia
salir = false
for (i=tmpDia;(i<=31&&!salir); i++){
nuevodiaant = nuevodia
nuevodia = nuevodia +1
d2.setDate(nuevodia)
//document.write (d2.getMonth() +1+"-"+tmpMes+"<br>")
if (d2.getMonth()+1!=tmpMes){
salir=true
document.write(" ULTIMO DIA DEL MES ACTUAL="+nuevodiaant+"<br>")
}else{
document.write(" DIA="+nuevodiaant+"<br>")
}
}
}
</script>
</HEAD>
<BODY onload="ver()">
</BODY>
</HTML> |