TomDuncan Active Member Licensed User Longtime User Jul 25, 2015 #1 hi all, I need to convert from a sqlite date string which returns "2015-06-01 11:40:00 AM" from my server. I need to convert this into a long so I can use Datetime. We use dd/MM/yyyy so you can see my problem. This is what I have tested. It does say that the default is yyyy-MM-dd hh:mm:ss But this throws an exception. The server returns the values via JSON. Any thoughts. Tom
hi all, I need to convert from a sqlite date string which returns "2015-06-01 11:40:00 AM" from my server. I need to convert this into a long so I can use Datetime. We use dd/MM/yyyy so you can see my problem. This is what I have tested. It does say that the default is yyyy-MM-dd hh:mm:ss But this throws an exception. The server returns the values via JSON. Any thoughts. Tom
imbault Well-Known Member Licensed User Longtime User Jul 25, 2015 #2 Try that: Code: Copy Dim cDateTime as string = "2015-06-01 11:40:00 AM" Dim nTicks as Long DateTime.DateFormat= "yyyy-MM-dd" DateTime.TimeFormat = "KK:mm:ss a" nTicks = DateTime.DateTimeParse( cDateTime.substring2(0,10) , cDateTime.substring(12)) Last edited: Jul 25, 2015 Upvote 0
Try that: Code: Copy Dim cDateTime as string = "2015-06-01 11:40:00 AM" Dim nTicks as Long DateTime.DateFormat= "yyyy-MM-dd" DateTime.TimeFormat = "KK:mm:ss a" nTicks = DateTime.DateTimeParse( cDateTime.substring2(0,10) , cDateTime.substring(12))