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

format date 1

Status
Not open for further replies.

gc1234

Programmer
Mar 4, 2004
94
GB
Hi

Anyone know how i can use format with date function to return

23/3/2004 format?
 
Using the FormatDateTime() function, you could achieve this result if the regional settings are set to read the values as such. However, since you likely cannot provide that this will always be true, you could just create a sub that would return a string value as you would like. Something akin to the following might work (you need to change to your purposes, but the idea should be here:
Code:
myDate = 3/23/2004 'This can be whatever date you want.
returnDate = day(myDate) & "/" & month(myDate) & "/" & year(myDate)
response.write returnDate

-----------------------------------------------------------------------------------------------------
"If you can't explain something to a six-year-old, you really don't understand it yourself."
-- Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top