Create a DateTime from a TextField

In a project, I have two TextFields: Start Date and End Date.

The user set them as SQLite.Date (YYYY-MM-DD).

How do I set a DateTime with these ?


DateStart = ParseDate(TF_DateStart.Text) // Error

For testing, I use:


Var Date_Start As New DateTime(2021, 1, 1)

“Now is the time” to use the TextFields…

Ideas ?

PS: the documentation is dry on that.

This help?
datetime

Var DateStart As DateTime = DateTime.FromString(TF_DateStart.Text)

Thank you guys… it may be time for me to take a nap.

Works fine Martin.

Loannis: I will read it after the nap…

:rwanda:

PS: apparently, I stopped to read at Constructor source As Date, go to Date, do not understand what’s there and stop reading the documentation…

1 Like