Foros del Web » Programando para Internet » ASP Clásico »

Fecha cambia formato en el servidor

Estas en el tema de Fecha cambia formato en el servidor en el foro de ASP Clásico en Foros del Web. Buenas a tod@s. ¿Alguien me podria decir como evitar que el servidor muestre la fecha en formato mm/dd/aaaa? En la bd la almaceno: dd/mm/aaaa y ...
  #1 (permalink)  
Antiguo 09/09/2002, 19:49
 
Fecha de Ingreso: mayo-2002
Mensajes: 35
Antigüedad: 22 años, 1 mes
Puntos: 0
Fecha cambia formato en el servidor

Buenas a tod@s.

¿Alguien me podria decir como evitar que el servidor muestre la fecha en formato mm/dd/aaaa?

En la bd la almaceno: dd/mm/aaaa y al ejecutar la aplicacion en local la muestra tambien asi, pero al subirla al servidor la cambia por el otro formato.

Gracias por adelantado.

Saludos.
  #2 (permalink)  
Antiguo 09/09/2002, 21:53
Avatar de ashketchum  
Fecha de Ingreso: julio-2001
Ubicación: En algun lugar de un gran pais
Mensajes: 418
Antigüedad: 22 años, 11 meses
Puntos: 0
Re: Fecha cambia formato en el servidor

Escribe esto:

antes del HTML

Código:
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>					
function DoDateTime(str, nNamedFormat, nLCID)				
	dim strRet								
	dim nOldLCID								
										
	strRet = str								
	If (nLCID > -1) Then							
		oldLCID = Session.LCID						
	End If									
										
	On Error Resume Next							
										
	If (nLCID > -1) Then							
		Session.LCID = nLCID						
	End If									
										
	If ((nLCID < 0) Or (Session.LCID = nLCID)) Then				
		strRet = FormatDateTime(str, nNamedFormat)			
	End If									
										
	If (nLCID > -1) Then							
		Session.LCID = oldLCID						
	End If									
										
	DoDateTime = strRet							
End Function									
</SCRIPT>
y formatea el texto asi:

Código:
 <%= DoDateTime((Recordset1.Fields.Item("Fecha").Value), 2, 2070) %>
Espero te sirva

saludos y suerte

<img src="http://www.velazquez.com.mx/masteraspx/firma.jpg" width="465" height="79" border="0" usemap="#URL">
<map name="URL">
<area shape="rect" coords="270,48,347,61" href="http://www.masteraspx.tk" target="_blank">
</map>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:16.