Setting cookie expiration six months in the future

Session.Cookies.Set requires a class Date for the expiration parameter. Can’t figure out how to do date math with a class Date.

Easy with Xojo.Core.Date, but cannot figure out how to convert the core date to a class Date. I cannot get ParseDate to work…

Dim myDate As Xojo.Core.Date = Xojo.Core.Date.Now Dim sixMonths As New Xojo.Core.DateInterval sixMonths.months = 6 myDate = myDate+sixMonths Dim expirationDate As Date Dim converted As Boolean = ParseDate(myDate.ToText, expirationDate)

ParseDate fails. Any help to either do the date math with a class Date or to convert the core date to a class Date would be appreciated.


Another approach:

Dim expirationDate As New Date
expirationDate.Month = expirationDate.Month + 6

@Pietro Beccegato Perfect. Thank you!!

I new it had to be something simple. Just could not figure it out.

Thanks again.