vendredi 28 décembre 2018

VB.net Create Date Killswitch (Compare two Dates)

Id like to implement a killswitch based on a date into my app so that Itll stop working by a certain time. Therefore I figured out on date (eg. 1st of February 2019). Once the Date of the system where my app is running on is greater than the Killswitch date, I want it to stop working. I tried

If Today.Date.toString() >= "02/01/2019" Then
End
Else
...

That didnt work. The problem I have is that the date format is different on each computer, some have MM/dd/YYYY, some dd/MM/YYYY and some YYYY/MM/dd. Is it still possible to convert all dates to a universal format and compare them?

Aucun commentaire:

Enregistrer un commentaire