Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Convert into DDMMYY format

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
Does anyone know how I can take the date and then convert it into a DDMMYY format ?
It is being used in an ASP page that calls the current days logs so there can't be any /.
 
<%
Dim theDay, theMonth, theYear, theDate
theDay = Day(now())
if cstr(theDay) < 2 then
theDay = &quot;0&quot; & theDay
end if
theMonth = Month(now())
if cstr(theMonth) < 2 then
theMonth = &quot;0&quot; & theMonth
end if
theYear = Year(now())
theDate = theYear & theMonth & theDay '(swap these around for how you want it)
response.write(theDate)
%>


Hope that helps
 
man where were you when I needed ya... heheh...
my problem was that I wanted to get my data and time to line up perfectly on a page with a list of times

MM-DD-YYYY hh:mm: tt

I finally did get it to work by first going into the control panel and changing the format in regional settings. And also by editing the registry:

HKEY_USERS/.DEFAULT/Control Panel/International

then with the FormatDateTime(date) method I got it the way I wanted. sorta (grin)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top