double figure of day and month

A

Andrew

Hi,

I am going to use the date as my filename. How can I convert date()
["5/18/04"] to "20040518"? Thanks a thousand.
 
A

Aaron Bertrand [MVP]

<%
filename = year(date) & _
right("00" & month(date), 2) & _
right("00" & day(date), 2)

response.write filename
%>
 
A

Andrew

Thank you very much.

--
Andrew



Aaron Bertrand said:
<%
filename = year(date) & _
right("00" & month(date), 2) & _
right("00" & day(date), 2)

response.write filename
%>

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




Andrew said:
Hi,

I am going to use the date as my filename. How can I convert date()
["5/18/04"] to "20040518"? Thanks a thousand.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top