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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dd/mm/yyyy format

Status
Not open for further replies.

D2C

Programmer
Aug 27, 2001
86
BE
Hello,

does somebody know how I can change my date format from mm/dd/yyyy to dd/mm/yyyy?


It's kindy urgent...

tnx a lot!

d2c
 
try
response.write (datepart("d",date) & "/" & datepart("m",date) & "/" & datepart("YYYY",date))

Let me know if this is what you are looking for

 
String manipulation. This is courtesy of Bullschmidt from another thread. Not exactly what you're looking for but your answer is somewhere in there:

To make a variable be in the format of yyyymmdd, perhaps try something like the following which you might even make into a function:

varFld = CDate(MyVariable)

intMonth = Month(varFld)
intDay = Day(varFld)
intYr = Year(varFld)

If intMonth < 10 Then
strMonth = &quot;0&quot; & CStr(intMonth)
Else
strMonth = CStr(intMonth)
End If

If intDay < 10 Then
strDay = &quot;0&quot; & CStr(intDay)
Else
strDay = CStr(intDay)
End If

varFld = CStr(intYr & strMonth & strDay)
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 
check onpnt's FAQ on this (see the FAQ button at top of this page..):
FAQ333-3194
also some very good stuff here:


we need an acronym like RTFF


Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top