using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DateTimeformat
{
class Program
{
static void Main(string[] args)
{
DateTime dt = new DateTime(2014, 3, 9, 16, 5, 7, 123);
Console.WriteLine("\nShow time with minute using shorformat");
Console.WriteLine("-----------------------------------");
Console.WriteLine("{0}", String.Format("{0:t}", dt));
Console.WriteLine("\nShow time with minute and second using LongTime");
Console.WriteLine("-----------------------------------");
Console.WriteLine("{0}", String.Format("{0:T}", dt));
Console.WriteLine("\nShow LongDate with ShortTime");
Console.WriteLine("-----------------------------------");
Console.WriteLine("{0}", String.Format("{0:f}", dt));
Console.WriteLine("\nShow LongDate with Longtime");
Console.WriteLine("-----------------------------------");
Console.WriteLine("{0}", String.Format("{0:F}", dt));
Console.WriteLine("\nShow ShortDate with ShortTime");
Console.WriteLine("-----------------------------------");
Console.WriteLine("{0}", String.Format("{0:g}", dt));
Console.WriteLine("\nShow ShortDate with Longtime");
Console.WriteLine("-----------------------------------");
Console.WriteLine("{0}", String.Format("{0:G}", dt));
Console.ReadLine();
}
}
}