document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DateTimeDemo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var  today = DateTime.Now;          
  14.             var  duration = new TimeSpan(0, 0, 0, 0);            
  15.             DateTime newday = today.Add(duration);
  16.  
  17.             Console.WriteLine("{0}", newday);
  18.             /* Out: 9/23/2013 1:31:50:AM */
  19.             Console.WriteLine("{0:yyyy}", newday);
  20.             /* Out: 2013 */
  21.             Console.WriteLine("{0:MMMM}", newday);
  22.             /* Out: Septemper */
  23.             Console.WriteLine("{0:dd}", newday);
  24.             /* Out: 23 */
  25.             Console.WriteLine("{0:HH}", newday);
  26.             /* Out: 01 */
  27.             Console.WriteLine("{0:mm}", newday);
  28.             /* Out: 31 */
  29.             Console.WriteLine("{0:ss}", newday);
  30.             /* Out: 50 */
  31.             Console.WriteLine("{0:tt}", newday);
  32.             /* Out: AM */                
  33.             Console.ReadLine();
  34.         }
  35.     }
  36. }
');