I think I forgot how to do this - is there a most straight forward way to assign a date field value to a xojo.core.date object ?
Dim rs As recordset = db.sqlselect("SELECT * FROM Items")
Using Xojo.Core
Dim d As xojo.core.date
d = rs.field("datefield").datevalue // doesn't work because d type is not the same as datevalue type
Maybe try something like this:
Dim d As Date = rs.Field("DateField").DateValue
Dim xcd As New Xojo.Core.Date(d.Year, d.Month, d.Day, Xojo.Core.TimeZone.Current)
[quote=233116:@Paul Lefebvre]Maybe try something like this:
[code]
Dim d As Date = rs.Field(“DateField”).DateValue
Dim xcd As New Xojo.Core.Date(d.Year, d.Month, d.Day, Xojo.Core.TimeZone.Current)
[/code][/quote]
Got it. I thought there was something a bit more elegant, but that will work.
Thanks.
I haven’t tried yet, but this may work:
Using Xojo.Core
Dim d As Date = Date.FromText(rs.Field("DateField").StringValue)