Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Ola pessoal como faço para resgatar com "0" as datas, por exemplo estou fazendo assim
<%=Day(RS("SessData"))%>-<%=Month(RS("SessData"))%>-<%=Year(RS("SessData"))%>
Ele esta resgatando assim
2/3/2013
gostaria que ficasse assim
02/03/2013
como faço?
Isso mesmo.
Obrigado
use assim:
Formato: aaaa-mm-dd
<%
Function ConverterDataBanco(ConDataBanco)
ConDataBanco = Year(ConDataBanco) &"-"& Right("0"&Month(ConDataBanco),2) &"-"& Right("0"&Day(ConDataBanco),2)
ConverterDataBanco = ConDataBanco
End Function
Response.Write(ConverterDataBanco(Date()))
%>
Formato: dd-mm-aaaa
<%
Function ConverterDataBanco(ConDataBanco)
ConDataBanco = Right("0"&Day(ConDataBanco),2) &"-"& Right("0"&Month(ConDataBanco),2) &"-"& Year(ConDataBanco)
ConverterDataBanco = ConDataBanco
End Function
Response.Write(ConverterDataBanco(Date()))
%>
Formato: mm-dd-aaaa
<%
Function ConverterDataBanco(ConDataBanco)
ConDataBanco = Right("0"&Month(ConDataBanco),2) &"-"& Right("0"&Day(ConDataBanco),2) &"-"& Year(ConDataBanco)
ConverterDataBanco = ConDataBanco
End Function
Response.Write(ConverterDataBanco(Date()))
%>
Formato: mm/dd/aaaa
<%
Function ConverterDataBanco(ConDataBanco)
ConDataBanco = Right("0"&Month(ConDataBanco),2) &"/"& Right("0"&Day(ConDataBanco),2) &"/"& Year(ConDataBanco)
ConverterDataBanco = ConDataBanco
End Function
Response.Write(ConverterDataBanco(Date()))
%>