Last active
December 22, 2016 07:20
-
-
Save steentottrup/772f7221788556313fa4fca036ac9133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace ConsoleApplication3 { | |
class Program { | |
static void Main(string[] args) { | |
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); | |
Thread.CurrentThread.CurrentTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Mountain Standard Time"); | |
DateTime postedDk = new DateTime(2016, 12, 17, 6, 28, 0, DateTimeKind.Local); | |
Console.WriteLine($"Posted by me, in Denmark, at {postedDk.ToLongDateString()} {postedDk.ToLongTimeString()} local time"); | |
Console.WriteLine($"And displays as {Thread.CurrentThread.CurrentTimeZone.DisplayName} time: {postedDk.ToLongDateString(Thread.CurrentThread.CurrentTimeZone)} {postedDk.ToLongTimeString(Thread.CurrentThread.CurrentTimeZone)}"); | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment