Function to convert VB date to MySQL date
Post by websitegear on
Jul 31, 2006 2:51:55 AM CST
Here is the code to convert a VB date to MySQL format.
function toSQLDate(dateInput)
strYear = CStr(Year(dateInput)) strMonth = CStr(Month(dateInput)) strDay = CStr(Day(dateInput)) strHour = CStr(Hour(dateInput)) strMinute = CStr(Minute(dateInput)) strSecond = CStr(Second(dateInput))
If Len(strhour) = 1 Then strhour = "0" & strhour ElseIf Len(strhour) = 0 Then strhour = "00" End If
If Len(strMinute) = 1 Then strminute = "0" & strMinute ElseIf Len(strMinute) = 0 Then strminute = "00" End If
If Len(strSecond) = 1 Then strsecond = "0" & strSecond ElseIf Len(strSecond) = 0 Then strsecond = "00" End If
If Len(strDay) = 1 Then strday = "0" + strDay ElseIf Len(strDay) = 0 Then strday = "00" End If If Len(strMonth) = 1 Then strmonth = "0" & strMonth ElseIf Len(strMonth) = 0 Then strmonth = "00" End If
toSQLDate = strYear + "-" + strmonth + "-" + strday + " " + strhour + ":" + strminute + ":" + strsecond end function
|
|
|
|
|
|
|
How to develop a Flxexible Web Design | Mar 5, 2013
|
|
Website comments on updates / improvements please | Feb 28, 2013
|
|
WebsiteGear Introduces Unlimited Web Survey Plan | Dec 4, 2012
|
|
HTML TAGGING PROJECT CONVERSION 100% QUALITY | Nov 28, 2012
|
|
Backup Your Files, Photos, Music online For Free | Nov 25, 2012
|
|
5 common link building mistakes | Aug 27, 2011
|
|
How to convert psd into html? | Jan 15, 2011
|
|
How to choose the right PHP Framework for web deve | Jan 12, 2011
|
|
|
|
|