using System; using System.Collections.Generic; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { DateTime dateTime = DateTime.Now; Console.WriteLine(dateTime.ToString("dddd dd yyyy")); Console.WriteLine(dateTime.ToString("ddd dd yyyy")); Console.WriteLine(dateTime.ToString("HH:mm:ss")); Console.WriteLine(dateTime.ToString("hh:mm")); Console.WriteLine(dateTime.ToString("mm/dd/yyyy HH:mm")); Console.WriteLine(dateTime.ToString("dd/yyyy")); Console.WriteLine(dateTime.Year); Console.WriteLine(dateTime.Date); Console.WriteLine(dateTime.DayOfWeek); Console.WriteLine(dateTime.DayOfYear); Console.WriteLine(dateTime.Day); Console.ReadLine(); } } }
Monday, June 20, 2011
how to format Date Time in C#
Labels:
asp.net
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment