World Clock Using Windows Forms

I developed a C# application for finding World Timings given the US Central Timing. I have used several labels and textboxes, one group box and two buttons in this Windows application. I have used labels to label all Time Zones, textboxes to display their corresponding timings and group box to group all labels and text boxes. I used two buttons: One to get the corresponding time for that time zone and the second is Exit button to exit the application.

The first text box takes the date and time of US Central timing in this format: 2/2/2002 6:00:00 OR 6:00:00 (In this case it will take today's date) OR 2/2/2002 (In this case it will consider as midnight time of US Central Timing). If you didn't follow these formats it will give an unexceptional handling error. After pressing the getTime button it will calculate the date and time for all time zones. In the code I used DateTime Constructor to Convert string in the textbox1 into date and date back again into string.

To run this application, create a Windows application in VS.NET and copy the attached code as Form1.cs and run it.

WorldClockWinFormARP.jpg


Similar Articles