SQLite DateValue to DateTime

using 2019r2.1

oMember.dBirthDate            = rs.Field("BirthDate").DateValue

have a birthdate in a SQLite database and need to convert it to DateTime format to use the following code (or something similar):

[code]dim r As DateDifferenceMBS
dim dToday As DateTime = DateTime.Now

r = new DateDifferenceMBS(dBirthDay, dToday)

Return r.Year[/code]

Can someone please tell me how to make the proper conversions.

(too many conflicting date formats)

I’m guessing oMember.dBirthDate is a Date?

yes, built with the oMember.dBirthDate = rs.Field(“BirthDate”).DateValue statement

For some reason, I thought DateTime had Operator_Convert built in for Date, but I see now that it doesn’t (yet, at least).

I’m afraid I can offer no assistance here. I simply haven’t dived into API 2 enough. Sorry.

Convert TotalSeconds from the Date date object to SecondsFrom1970 and use that to create a new DataTime instance.


dim dt as new DateTime( d )

But I don’t think that’s the issue here.

or create an extends for Date that converts to a datetime as Karen indicated then you can write

oMember.dBirthDate = rs.Field("BirthDate").DateValue.ToDateTime

Right. For those with access, try the beta.