Hi I'm working with c# simple application to display system date time.
textbox.Text = DateTime.Now.ToString("MM/dd/yyyy");
but it is showing result as : 05-12-2010
What is the problem with this code? or do I need to change any where in the regional settings of my machine.
thank you
strftime() is a function in C which is used to format date and time. It comes under the header file time. h, which also contains a structure named struct tm which is used to hold the time and date.
the "/" represents the locale datetime seperator. Im guessing that
DateTime.Now.ToString(@"MM\/dd\/yyyy");
will do what you want.
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With