ParseData doesn't give proper time but no error

Hi guys,

first time asking so please excuse if I can’t formulate it in the “proper” way or miss out important information

I’m using ParseDate to convert a string which has a date & time in it (8/1/2013 16:31:06) into a date variable. The function returns TRUE and contains the correct date (8/1/2013) but not the correct time (0:00:00). What is wrong with this code?

Dim sValue As String Dim dtJoin_Date As Date If ParseDate(sValue, dtJoin_Date) = FALSE Then MsgBox ("Error 2 - wrong date format") Return FALSE End If

Long time is set to H:mm:ss in the region and language of my Windows computer

Thanks in advance,


ParseDate does not parse TIME or the time portion of a DateTime String, this is indicated in the Lang Ref.

Thanks Dave, how can I then add the time part to the date variable without manually parsing the string into it’s hour, time and second components and then individually setting them? Is there a similar function that does this?


You have to create it yourself… or find someone who has already done sometime similar.

I may have something somewhere… if I can find it I will post it here