using TenantUtil; // Get the current date and time in the EST time zone DateTime now = TenantUtil.DateTimeNow.GetDateTimeNow("America/New_York"); // Display the date and time Console.WriteLine("The current time in EST is {0}", now.ToString());
using TenantUtil; // Get the current date and time in the user's local time zone DateTime now = TenantUtil.DateTimeNow.GetDateTimeNow(); // Display the date and time Console.WriteLine("The current time in your time zone is {0}", now.ToString());This code uses the DateTimeNow method with no arguments to get the current date and time in the user's local time zone, and then displays it in the console. The TenantUtil library is not a built-in package in C#, but rather a custom-made library that must be included as a reference in your project.