csharp conver date utc to cst

Code Example - csharp conver date utc to cst

                
                        DateTime currentTime = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time")); 
                    
                
 

csharp convert utc to est

                        
                                var timeUtc = DateTime.UtcNow;
var easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
var today = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, easternZone);
                            
                        
 

Related code examples