String to Date Conversion

R

RN1

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top