Setting TimeZone with C++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neo

    Setting TimeZone with C++

    Hi,
    Can anybody help me in writing a standard C++ program to set timezone to CST ?
    -Thanks,
    Venkat
  • Ali R.

    #2
    Re: Setting TimeZone with C++


    "Neo" <niftyhawk@yaho o.com> wrote in message
    news:869d45b0.0 311131117.128c0 388@posting.goo gle.com...[color=blue]
    > Hi,
    > Can anybody help me in writing a standard C++ program to set timezone to[/color]
    CST ?[color=blue]
    > -Thanks,
    > Venkat[/color]

    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.


    Comment

    • Derek Baker

      #3
      Re: Setting TimeZone with C++

      "Neo" <niftyhawk@yaho o.com> wrote in message
      news:869d45b0.0 311131117.128c0 388@posting.goo gle.com...[color=blue]
      > Hi,
      > Can anybody help me in writing a standard C++ program to set timezone to[/color]
      CST ?[color=blue]
      > -Thanks,
      > Venkat[/color]

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

      --
      Derek


      Comment

      • Ekkehard Morgenstern

        #4
        Re: Setting TimeZone with C++


        Hi Neo,

        "Neo" <niftyhawk@yaho o.com> schrieb im Newsbeitrag
        news:869d45b0.0 311131117.128c0 388@posting.goo gle.com...[color=blue]
        > Can anybody help me in writing a standard C++ program to set timezone to[/color]
        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.



        Comment

        Working...