This is because you did it wrong in first place. Why would you even need strings
date1
and
date2
? You should not to try to work with strings representing data (and, in case of date/time, even ambiguous), but work with data itself. If you store time data in SQLite, the way SQLite is designed to work with it:
http://www.sqlite.org/datatype3.html[
^],
http://www.sqlite.org/lang_datefunc.html[
^].
On .NET site, not touching string representation, convert time data into
System.DateTime
. As you are using only dates, you can convert integer number to
System.DateTime
using
http://msdn.microsoft.com/en-us/library/system.datetime.adddays(v=vs.110).aspx[
^].
If you still want to work with strings, leave just first line, where you assign value to the instance of your
DateTimePicker
.
—SA