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

retrieve date and change to DDMMYYYY format

Status
Not open for further replies.

leeolive

Programmer
May 14, 2002
46
GB
Hi

I want to submit the date along with other values to a db. It needs to be in DDMMYYYY format when submitted to db.

I have the below so far, which is not working and returns something like 00:00:0000

Dim strmyDate
strmyDate = Cdate(Request("Date"))
Response.Write strmyDate

Can anyone help?
Thanks
Lee
 
faq333-3194

_____________________________________________________________________
onpnt2.gif

 
Thanks for the link. Very useful. I have now got it working by using

Dim DateToday
DateToday = Day(Date()) & Month(Date()) & Year(Date())
Response.Write DateToday

This returns 28102003, which is what I want.

I am worried however that if the month was January, that the value returned would be
2812003 and not 28012003. Obviously I can't test this.

Can anyone confirm that the above code will return 01(January) etc for the month instead of 1?

Thanks, much appreciated!
Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top