Formatting a number into a time

  • Thread starter Thread starter suresh
  • Start date Start date
S

suresh

Hi,

I have a textbox that a user inputs a time that I then insert into SQL
server. In the code behind I add a date to the existing content. When I try
to insert into the database (field is smalldatetime) I receive and error.
The error occurs because the value does contain a colon.
How would I convert ex. 1/1/1900 300 AM into 1/1/1900 3:00 AM


Thanks,

Suresh
 
Hi Suresh,

When it is a string and VB net I mostly only have to do
datetime = CDate("1/1/1900 300 AM")

Maybe this works for you?

Cor
 
Back
Top