Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Date Time Conversion based on time zone
//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) { //Your code goes here //DateTime dt=DateTime.Now; DateTime dt= Convert.ToDateTime("2019-06-26 03:45:42.473"); TimeZoneInfo cstZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); DateTime cstTime = TimeZoneInfo.ConvertTimeFromUtc(dt, cstZone); Console.WriteLine("Pacific Standard Time= "+cstTime); cstZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); cstTime = TimeZoneInfo.ConvertTimeFromUtc(dt, cstZone); Console.WriteLine("Eastern Standard Time= "+cstTime); cstZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); cstTime = TimeZoneInfo.ConvertTimeFromUtc(dt, cstZone); Console.WriteLine("India Standard Time= "+cstTime); Console.WriteLine("---------------------------------------------------------"); foreach (TimeZoneInfo z in TimeZoneInfo.GetSystemTimeZones()) { Console.WriteLine(z.StandardName); } } } }
run
|
edit
|
history
|
help
1
Working nullable DateTime C#
C# - Creating XLS filename from datetime
The given number is prime or even
LINQ-Group BY
e
Get direct link from onedrive.com
adxasxsd
Sort A List of Ages of Students (Solution: Stack / O(N^3) Complexity)
ew
services