April 2002
Intermediate to advanced
1024 pages
23h 26m
English
An instance of a DateTime structure represents a point in time specified by a date and a time. This structure offers many date manipulation methods. Listing B.5 shows an example of some of the functionality of this structure (datetime.cs).
static void Main(string [] args) { Console.WriteLine("Min: {0} ", DateTime.MinValue); Console.WriteLine("Max: {0} ", DateTime.MaxValue); DateTime date = DateTime.Now; Console.WriteLine("Long DateTime {0} {1} ", date.ToLongDateString(), date.ToLongTimeString()); Console.WriteLine("Date: {0} ", date.Date); Console.WriteLine("Month: {0} ", date.Month); Console.WriteLine("Day: {0} ", date.Day); Console.WriteLine("Day of week: {0} ", date.DayOfWeek); Console.WriteLine("Day ... |
Read now
Unlock full access