using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DateTimeDemo
{
class Program
{
static void Main(string[] args)
{
var today = DateTime.Now;
var duration = new TimeSpan(0, 0, 0, 0);
DateTime newday = today.Add(duration);
Console.WriteLine("{0}", newday);
/* Out: 9/23/2013 1:31:50:AM */
Console.WriteLine("{0:yyyy}", newday);
/* Out: 2013 */
Console.WriteLine("{0:MMMM}", newday);
/* Out: Septemper */
Console.WriteLine("{0:dd}", newday);
/* Out: 23 */
Console.WriteLine("{0:HH}", newday);
/* Out: 01 */
Console.WriteLine("{0:mm}", newday);
/* Out: 31 */
Console.WriteLine("{0:ss}", newday);
/* Out: 50 */
Console.WriteLine("{0:tt}", newday);
/* Out: AM */
Console.ReadLine();
}
}
}