Setting TimeZone with C++

Discussion in 'C++' started by Neo, Nov 13, 2003.

  1. Neo

    Neo Guest

    Hi,
    Can anybody help me in writing a standard C++ program to set timezone to CST ?
    -Thanks,
    Venkat
     
    Neo, Nov 13, 2003
    #1
    1. Advertising

  2. Neo

    Ali R. Guest

    "Neo" <> wrote in message
    news:...
    > Hi,
    > Can anybody help me in writing a standard C++ program to set timezone to

    CST ?
    > -Thanks,
    > Venkat


    There is no Time Zone in standard C++. Actually I don't think that your
    computer really cares what timezone it's in, just the time.

    Ali R.
     
    Ali R., Nov 13, 2003
    #2
    1. Advertising

  3. Neo

    Derek Baker Guest

    "Neo" <> wrote in message
    news:...
    > Hi,
    > Can anybody help me in writing a standard C++ program to set timezone to

    CST ?
    > -Thanks,
    > Venkat


    What OS? Perhaps you should ask in a newsgroup for it.

    --
    Derek
     
    Derek Baker, Nov 13, 2003
    #3
  4. Hi Neo,

    "Neo" <> schrieb im Newsbeitrag
    news:...
    > Can anybody help me in writing a standard C++ program to set timezone to

    CST ?

    Refer to the documentation of your compiler's or OS's libraries.

    Most C libraries' time functions (defined in "time.h") evaluate an
    environment variable (like TZ) to detect the time zone in a UNIX-compatible
    manner. Some libraries contain functions like "tzset()" to set the time
    zone. That stuff existed before C++ so it's an anachronism really.

    It's better to write conditional code for every platform (operating system)
    you want to support and use the platform's specific time zone function which
    you find in the OS's programming documentation.

    I hope that helps.

    Regards,
    Ekkehard Morgenstern.
     
    Ekkehard Morgenstern, Nov 13, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    817
  2. asaf
    Replies:
    3
    Views:
    6,237
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Sep 11, 2006
  3. Lew
    Replies:
    0
    Views:
    842
  4. axrock
    Replies:
    8
    Views:
    1,006
    Roedy Green
    Mar 25, 2009
  5. Ami
    Replies:
    5
    Views:
    308
Loading...

Share This Page