Código fuente de 'Visualiza fecha larga.asp'
<html>
<head>
<title>Visualiza fecha larga - Códigos asp, programacion asp, descargas asp, rutinas asp</title>
</head>
<body style="font-family: Arial; font-size: 9pt">
<p align="center"><b><font size="3">Visualiza fecha larga</font></b></p>
<%
FUNCTION FechaCompleta(fecha)
'Defines the function. fecha will be any date that you put in there in the format #mm/dd/yyyy#. Ensure you put the #'s around the date. (ex: FechaCompleta(#12/25/2000) )
dia = Day(fecha)
'Gets the actual day number from the inputted date.
diasemana = WeekDay(fecha)
'Gets the number day of the week (from 1(Sunday) to 7(Monday)) from the inputted date. This is used in the next line to get 'the day of the weeks name.
dianame = WeekDayName(diasemana,false)
'Gets the day of the weeks name. The false ensures the long day name is returned (i.e. Monday instead of Mon.). If you want the shortened version returned, change this to true.
mes = Month(fecha)
'Gets the number month (1 to 12). Used below to get the month name.
mes = MonthName(mes)
'Gets the month name.
anyo = Year(fecha)
'Gets the year of the inputted date.
Response.Write dianame & ", "& dia & " " & mes & ", " & anyo
'Writes it all out.
END FUNCTION
%> La fecha actual es (utiliza una función de conversión): <% Response.Write fechaCompleta(Now())%>
<br><br>La fecha actual es (Response.Write(FormatDateTime(Now(),1)): <% Response.Write(FormatDateTime(Now(),1) & " " )%>
</body></html>