Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

System.TimeZone

The TimeZone class encapsulates information about time zones and provides conversion utilities between local time and UTC time. Listing B.17 provides an example using TimeZone (timezone.cs).

Listing B.17. TimeZone Example
 public class TimeZoneMain { static void Main(string [] args) { TimeZone tz = TimeZone.CurrentTimeZone; Console.WriteLine("{0} {1} ", tz.DaylightName, tz.StandardName); DaylightTime dt = tz.GetDaylightChanges(DateTime.Now.Year); Console.WriteLine("Start daylight savings time {0} ", dt.Start); Console.WriteLine("End daylight savings time {0} ", dt.End); Console.WriteLine("Daylight savings time change {0} ", dt.Delta); Console.WriteLine("Is daylight savings? {0} ", tz.IsDaylightSavingTime(DateTime.Now)); Console.WriteLine("UTC ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book