JOIN TWO STRINGS INTO A DATE TIME FORMAT ASP CLASSIC

lois waisbrooker

Total Post:70

Points:494
Posted by  lois waisbrooker
 1132  View(s)
Ratings:
Rate this:
Hi Expert,

I have two variables X and Y. X has a date as a string(12-Jun-2013) and Y has a time (12:46 pm) I need to put these two together into a date time format before inserting in into a database. Does anyone know what function I need to use to do this?

Thanks in advance for any recommendations or solutions.
  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: join two strings into a date time format asp classic

    Hi Lois,


    Append your two string, with a space, and use the CDate function to convert the whole thing to a date. So: CDate("12-Jun-2013 12:46 pm") will return the date-time value.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!