DateTime.ToShortTimeString() : DateTime « System « C# / C Sharp by API






DateTime.ToShortTimeString()

    

using System;

class MainClass
{
  public static void Main()
  {
    DateTime myDateTime11 = new DateTime(2004, 1, 15, 23, 2, 5);
    Console.WriteLine("myDateTime11 = " + myDateTime11);
    Console.WriteLine("myDateTime11.ToLongTimeString() = " +  myDateTime11.ToLongTimeString());
    Console.WriteLine("myDateTime11.ToShortTimeString() = " +  myDateTime11.ToShortTimeString());
  }
}

   
    
    
    
  








Related examples in the same category

1.new DateTime
2.new DateTime(0)
3.new DateTime(year, month, day, hour, minute, second, millisecond)
4.DateTime < DateTime
5.DateTime - TimeSpan
6.DateTime.Add(TimeSpan)
7.DateTime.AddSeconds
8.DateTime.AddYears
9.DateTime.Compare(DateTime first, DateTime second)
10.DateTime.Date
11.DateTime.DayOfWeek
12.DateTime.DaysInMonth
13.DateTime.Equals(DateTime dt)
14.DateTime.Equals(DateTime first, DateTime second)
15.DateTime.FromFileTime
16.DateTime.IsDaylightSavingTime()
17.DateTime.IsLeapYear
18.DateTime.Kind
19.DateTime.MaxValue
20.DateTime.Millisecond
21.DateTime.Now
22.DateTime.Parse
23.DateTime.ParseExact
24.DateTime.Second
25.DateTime.Subtract(TimeSpan t)
26.DateTime.Ticks
27.DateTime.TimeOfDay
28.DateTime.Today
29.DateTime.ToFileTime
30.DateTime.ToLongDateString()
31.DateTime.ToLongTimeString()
32.DateTime.ToShortDateString()
33.DateTime.ToString(String format)
34.DateTime.ToString(String format, CultureInfo ci)
35.DateTime.UtcNow
36.DateTime.Year