A TextBox displays the current date (in dd/mm/yyyy format) & time when
a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the
date into international format so that the remote server doesn't
generate any error, this is what I am doing:
---------------------------
Dim strSDate As String
Dim strSTime As String
Dim strStartDT As String
Dim strSDateTime As String
strSDateTime = txtSDateTime.Te xt
i = InStr(strSDateT ime, " ")
strSDate = Left(strSDateTi me, i - 1)
strSTime = (Mid(strSDateTi me, i + 1, Len(strSDateTim e)))
strStartDT = Year(CDate(strS Date)) & "/" & Month(CDate(str SDate)) &
"/" & Day(CDate(strSD ate)) & " " & strSTime
---------------------------
The above works perfectly on my local server but on the remote server,
the last line in the above code generates the following error:
--------------------------
Conversion from string "15/10/2008" to type 'Date' is not valid.
--------------------------
What am I doing wrong?
a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the
date into international format so that the remote server doesn't
generate any error, this is what I am doing:
---------------------------
Dim strSDate As String
Dim strSTime As String
Dim strStartDT As String
Dim strSDateTime As String
strSDateTime = txtSDateTime.Te xt
i = InStr(strSDateT ime, " ")
strSDate = Left(strSDateTi me, i - 1)
strSTime = (Mid(strSDateTi me, i + 1, Len(strSDateTim e)))
strStartDT = Year(CDate(strS Date)) & "/" & Month(CDate(str SDate)) &
"/" & Day(CDate(strSD ate)) & " " & strSTime
---------------------------
The above works perfectly on my local server but on the remote server,
the last line in the above code generates the following error:
--------------------------
Conversion from string "15/10/2008" to type 'Date' is not valid.
--------------------------
What am I doing wrong?
Comment