Sorry! We can't seem to find the resource you're looking for
>
FormatDateTime( Now,2) = 02/15/2008 (mm/dd/yyyy) for me.
>
If you need dd/mm/yyyy then you may have to construct it
using DatePart(); for example, (where "x" is your date):
>
DatePart("d",x) & "/" & DatePart("m",x) & "/" & DatePart("yyyy" ,x)
>
Be aware that the day and month returned are not left-zero filled;
that is, today's date will appear as 15/2/2008 unless adjusted.
>
>
"Paulo" <prbspfc@uol.co m.brwrote in message news:ezaNh0%23b IHA.1208@TK2MSF TNGP05.phx.gbl. ..
Any way to optimize it ?
>
<% sDia = ""
sMes = ""
sAno = ""
sData = ""
if not IsNull(rs("DT_E XAME")) then
sDia = Day(rs("DT_EXAM E"))
sMes = Month(rs("DT_EX AME"))
sAno = Year(rs("DT_EXA ME"))
if Len(sDia) = 1 then sDia = "0" & sDia
if Len(sMes) = 1 then sMes = "0" & sMes
sData = sDia & "/" & sMes & "/" & sAno
end if
%>
>
returns the dd/mm/yyyy coming from a db date field with left-zero filled
>
"McKirahan" <News@McKirahan .comescreveu na mensagem news:TKSdnZ9gsJ UZKyjanZ2dnUVZ_ tWtnZ2d@comcast .com...
>"Paulo" <prbspfc@uol.co m.brwrote in message
>news:OmnBlm#bI HA.1960@TK2MSFT NGP02.phx.gbl.. .
>>Any function on ASP to format date on dd/mm/yyyy?
>>The format (VB) function does not work on ASP ?
>>
>FormatDateTime () may meet your needs.
>>
>VBScript FormatDateTime Function
>http://www.w3schools.com/vbscript/fu...atdatetime.asp
>>
>FormatDateTime (Now,2) = 02/15/2008 (mm/dd/yyyy) for me.
>>
>If you need dd/mm/yyyy then you may have to construct it
>using DatePart(); for example, (where "x" is your date):
>>
>DatePart("d",x ) & "/" & DatePart("m",x) & "/" & DatePart("yyyy" ,x)
>>
>Be aware that the day and month returned are not left-zero filled;
>that is, today's date will appear as 15/2/2008 unless adjusted.
>>
>>
"Paulo" <prbspfc@uol.co m.brwrote in message
news:ezaNh0#bIH A.1208@TK2MSFTN GP05.phx.gbl...
Any way to optimize it ?
>
<% sDia = ""
sMes = ""
sAno = ""
sData = ""
if not IsNull(rs("DT_E XAME")) then
sDia = Day(rs("DT_EXAM E"))
sMes = Month(rs("DT_EX AME"))
sAno = Year(rs("DT_EXA ME"))
if Len(sDia) = 1 then sDia = "0" & sDia
if Len(sMes) = 1 then sMes = "0" & sMes
sData = sDia & "/" & sMes & "/" & sAno
end if
%>
>
returns the dd/mm/yyyy coming from a db date field with left-zero filled
[snip]
Please don't top post as it makes the conversation harder to follow.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
"McKirahan" <News@McKirahan .comwrote in message news:odKdnU_-1uNTXyjanZ2dnUV Z_gmdnZ2d@comca st.com...
function dateToString(d, frmt)
aF = split(frmt,"/")
for i=0 to 2
if aF(i) = "d" then aF(i) = day(d)
if aF(i) = "dd" then aF(i) = right("0"&day(d ),2)
if aF(i) = "m" then aF(i) = month(d)
if aF(i) = "mm" then aF(i) = right("0"&month (d),2)
if aF(i) = "yyyy" then aF(i) = year(d)
next
dateToString= join(aF,"/")
end function
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
>>
>[snip]
>>
>Interesting idea; however, the following
>>
><%
>Response.Wri te "<li>" & FormatDateTime( Now,2)
>Session.lcid=2 057 '= UK English
>Response.Wri te "<li>" & FormatDateTime( Now,2)
>Session.lcid=1 033 '= US English
>Response.Wri te "<li>" & FormatDateTime( Now,2)
>%>
>>
>returned (for me):
>>
>2/15/2008
>15/02/08
>2/15/2008
>>
>>
Comment