Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Need date format for mySQL: YYYY-MM-DD

Posted 06 Apr 2004 01:24:46
1
has voted
06 Apr 2004 01:24:46 Jeff Bourassa posted:
What is the DoDateTime codes to set a date value/format to YYYY-MM-DD for use with mySQL. Have been looking around and cannot seem to find this? Anyone have any ideas. Thanks, Jeff

Replies

Replied 06 Apr 2004 17:38:09
06 Apr 2004 17:38:09 stuart steele replied:
Dates are troublesome, I tend to split them up and re-build them in the format you display as ODBC should alway insert them in the right place if you do that.

you could try this

sTmp = year(sYouryearVal) & "-" & month(sYourMonthVal) & "-" & Day(sYourDayVal).

It really does depend on where the date comes from with respect to forms or system generated.

I don't recal an ASP function called doDateTime() you could try format() and formatdatetime() but I prefer the top method

---
Stuart D Steele
www.stuweb.co.uk
www.swim-masterclass.co.uk
Replied 07 Apr 2004 03:00:32
07 Apr 2004 03:00:32 Phil Shevlin replied:
Did you try:

FormatDateTime('yyyy-mm-dd', rs("field");

Reply to this topic