I am probably being exceptionally obtuse, but when I take valid date string from a text box, parse it into a ticks long, and then query the long with DateTime.GetMonth, it returns 1, regardless of the actual month. The year and Day-of-month are returned correctly. Also, if I use DateTime.Parse on DateTime.Now, it works correctly.
Dim dateNow As Int = DateTime.GetMonth(DateTime.Now)
Msgbox(dateNow, "Month Now") - This works as expected.
selectedDate = DateTime.DateParse(txtDate.Text)
Dim Month As Double = DateTime.GetMonth(selectedDate)
Msgbox(Month, "Month") - Always returns 1, whatever the month.
What am I missing, please?
Dim dateNow As Int = DateTime.GetMonth(DateTime.Now)
Msgbox(dateNow, "Month Now") - This works as expected.
selectedDate = DateTime.DateParse(txtDate.Text)
Dim Month As Double = DateTime.GetMonth(selectedDate)
Msgbox(Month, "Month") - Always returns 1, whatever the month.
What am I missing, please?