By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,193 Members | 826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,193 IT Pros & Developers. It's quick & easy.

Setting TimeZone with C++

P: n/a
Neo
Hi,
Can anybody help me in writing a standard C++ program to set timezone to CST ?
-Thanks,
Venkat
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Neo" <ni*******@yahoo.com> wrote in message
news:86**************************@posting.google.c om...
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.
Jul 19 '05 #2

P: n/a
"Neo" <ni*******@yahoo.com> wrote in message
news:86**************************@posting.google.c om...
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
Jul 19 '05 #3

P: n/a

Hi Neo,

"Neo" <ni*******@yahoo.com> schrieb im Newsbeitrag
news:86**************************@posting.google.c om...
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.

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.