This method is used to convert the value of the current DateTime object to its equivalent short time string representation.
Syntax: public string ToShortTimeString ();
Return Value: This method returns a string that contains the short time string representation of the current DateTime object.
Below programs illustrate the use of DateTime.ToShortTimeString() Method:
ShortTime is 04:00
ShortTime of 01/03/2010 04:00:15 is 04:00 ShortTime of 01/05/2010 04:00:15 is 04:00
- Difference between Method Overriding and Method Hiding in C#
- C# | Uri.IsHexEncoding() Method
- Queue.Contains() Method in C#
- C# | Insert() Method
- C# | Replace() Method
- Anonymous Method in C#
- C# | IndexOfAny() Method
- Extension Method in C#
- C# | Uri.ToString() Method
- C# | ToLower() Method
- C# | StartsWith() Method
- C# | Math.Log() Method
- C# | Copy() Method
- C# | Remove() Method
- C# | ToUpper() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.