Author: RN5A | Posted on: 10/15/2008 1:52:27 AM | Views : 330

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.Text

i = InStr(strSDateTime, " ")
strSDate = Left(strSDateTime, i - 1)
strSTime = (Mid(strSDateTime, i + 1, Len(strSDateTime)))

strStartDT = Year(CDate(strSDate)) & "/" & Month(CDate(strSDate)) & "/" & Day(CDate(strSDate)) & " " & 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:

--------------------------
Conve ...

Go to the complete details ...