Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Computing Time Zone Different
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { var pst = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); var cst = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); var gmt = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"); var cet = TimeZoneInfo.FindSystemTimeZoneById("Central Europe Standard Time"); var est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); var now = DateTimeOffset.UtcNow; TimeSpan pstOffset = pst.GetUtcOffset(now); TimeSpan cstOffset = cst.GetUtcOffset(now); TimeSpan gmtOffset = gmt.GetUtcOffset(now); TimeSpan estOffset = est.GetUtcOffset(now); /* Crockett time difference reference to the Eastern time zone */ TimeSpan difference = pstOffset - estOffset; Console.WriteLine("Pacific Standard Time Difference = " + difference.Hours); /* Chalmette & Nashville time difference reference to the Eastern time zone */ TimeSpan difference2 = cstOffset - estOffset; Console.WriteLine("Central Standard Time Difference = " + difference2.Hours); /* London, Plaistow & Lisbon time difference reference to the Eastern time zone */ TimeSpan difference3 = gmtOffset - estOffset; Console.WriteLine("Greenwich Mean Time Difference = " + difference3.Hours); /* Weissenfels time difference reference to the Eastern time zone */ TimeSpan cetOffset = cet.GetUtcOffset(now); TimeSpan difference4 = cetOffset - estOffset; Console.WriteLine("Central Eastern Time Difference = " + difference4.Hours); // convert to a number ToInt16(String) } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Extension Method Sample
Task List
EqualityComparer
two words are anagrams
Šovljanski - beskonačna petlja bez goto-a
ds
SpiltStringBetweenSpecialCharacters
With Arguments
Test
a.k.java
Please log in to post a comment.