Sample Code: Expiration Date in Date-Time format

Just sorted my need for a 30-min deadline placed on email verification code check - you may find this helpful!

I created some code to create an email verify system and password reset system for users of the app that I am writing. While this code is for Date and Time in text format and is NOT in timestamp format… here’s what I got so far.

IF you need a date - time deadline calculator - here is the code:

Var date1 As DateTime = DateTime.Now
Var days1 As Double = date1.SecondsFrom1970 + 1800
Var date2 As New DateTime(days1, TimeZone.Current)

var stringyy as String = date1.ToString + " - " + date2.ToString

MessageBox(stringyy)

Hope this helps!

1 Like

have also a look at DateInterval, its very useful if it exists in you xojo version.

Var date2 As DateTime = DateTime.Now + New DateInterval(0, 0, 0, 0, 30)

2 Likes

2020 r2 is my current version. I am porting all my projects to it / developing exclusively on it right now.

“The trend is your friend.” - every successful day trader, like, ever

1 Like

current trend is r2.1 :wink: