How to write a program for Time Zones?

This is a discussion on How to write a program for Time Zones? within the C Programming forums, part of the General Programming Boards category; I want to create a GUI using C, for displaying time when a time zone is selected. I absolutely don't ...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    2

    How to write a program for Time Zones?

    I want to create a GUI using C, for displaying time when a time zone is selected.

    I absolutely don't know how to write a program for that. Can you please guide me how to get the time of a zone displayed when the zone name is given as input.

    Thank You.

    Sarath Karanam.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Have you read the documentation for the stuff in the time.h header? Specifically, a tm object returned by gmtime can be adjusted from UTC to other time zones with relative ease (see the example for gmtime). From there it's a simple matter of working out the time zone offset from UTC for the name given. But that can be a straight table lookup.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    2
    Thank you Prelude

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Collision boxes,zones, and allocation
    By ~Kyo~ in forum Game Programming
    Replies: 1
    Last Post: 11-28-2011, 10:28 AM
  2. FireWire and the difficulty of time zones
    By Aparavoid in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-27-2009, 04:56 PM
  3. last write time
    By pastitprogram in forum C++ Programming
    Replies: 2
    Last Post: 07-31-2008, 07:54 PM
  4. How to get the last write time of a file?
    By maxorator in forum Windows Programming
    Replies: 1
    Last Post: 12-12-2005, 09:52 AM
  5. write a program that will set the time to 5:58
    By jupimako in forum C++ Programming
    Replies: 2
    Last Post: 11-05-2003, 03:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21