If it's bound select '(Advanced)' in DataBindings property where you select 'Date Time' format and the short date type. Also rather than a Textbox it's better to use a MaskedTextBox and set it's input format to 'Short date'.
Note that setting the date string formats explicitly to a format that only conforms to a single culture rarely is a good idea. In JB example using the short date format "d" would be culture independent, and same as using the ToShortDateString method.
No, ToShortDateString is the culture independent "d" format, it displays the short date according to how short date strings is configured in computer regional settings.
Hi john,
I have used txtDate.Text=Now.ToShortTimeString and its output is in MM-DD-YYYY format...
Also your solution sounds good but the problem is I cant go and change the regional time to DD-MM-YYYY format in all PC?
so plz suggest some other method that can be coded in pgm...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.