Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views1 page

Code

The document is a C# program that demonstrates the use of various DateTime properties and methods. It retrieves and displays the current date and time, today's date, the current UTC date and time, and the minimum and maximum values of DateTime. The program outputs these values to the console.

Uploaded by

twthyy9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Code

The document is a C# program that demonstrates the use of various DateTime properties and methods. It retrieves and displays the current date and time, today's date, the current UTC date and time, and the minimum and maximum values of DateTime. The program outputs these values to the console.

Uploaded by

twthyy9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//ProgrammingAdvices.

com
//Mohammed Abu-Hadhoud

using System;

namespace Main
{
internal class Program
{

static void Main(string[] args)


{

DateTime currentDateTime = DateTime.Now; //returns current date and


time
DateTime todaysDate = DateTime.Today; // returns today's date
DateTime currentDateTimeUTC = DateTime.UtcNow;// returns current UTC
date and time
DateTime maxDateTimeValue = DateTime.MaxValue; // returns max value of
DateTime
DateTime minDateTimeValue = DateTime.MinValue; // returns min value of
DateTime

Console.WriteLine("currentDateTime: "+currentDateTime);
Console.WriteLine("Today: " + todaysDate);
Console.WriteLine("currentDateTimeUTC: " + currentDateTimeUTC);
Console.WriteLine("minDateTimeValue: " + minDateTimeValue);
Console.WriteLine("maxDateTimeValue: " + maxDateTimeValue);

Console.ReadKey();

}
}
}

You might also like