VB.NET 2005, Get DateTime Calendar Formated Date Value
Posted on 2007-08-01
In Visual Studio 2005 using vb.net I have a dropdown calendar on a particular form. When a button is clicked i know how to get the calendars day, month and year.
This can be done to assign to a variable like so,
dim somevariable as string
somevariable = dtcalendar.value.day
Obviously we can do dtcalendar.value.month etc.
How can I in one line assign the dtcalendar's entire selected value but format the date.
What im trying to acheive is soemthing like so, just dont know how to do it
somevariable = dtcalendar.value.day + dtcalendar.value.month + dtcalendar.value.year.
I assume that there must be some way to grab the calendars selected date value and format it to DD-MM-YYYY so that I can just take that value straight to a variable?
Thanks in advance.