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

printing times in specific timezones

P: n/a
Given a time_t value, if you wanted to print the time in a specific
timezone, is there a better way then what I am currently doing which
seems really bad?

Currently I set the TZ system environment variable, call tzset, then
use localtime to create a struct tm.

This process is slow to execute and also has issues with multiple
threads all setting the single TZ variable.

I would appreciate any leads.

Thanks,
--
Ivan
http://www.0x4849.net

Dec 22 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ivan Novick wrote:
Given a time_t value, if you wanted to print the time in a specific
timezone, is there a better way then what I am currently doing which
seems really bad?

Currently I set the TZ system environment variable, call tzset, then
use localtime to create a struct tm.

This process is slow to execute and also has issues with multiple
threads all setting the single TZ variable.

I would appreciate any leads.
I don't think there is anything available in Standard C++. Have you
tried looking in the manual for your OS?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Dec 22 '06 #2

P: n/a

Victor Bazarov wrote:
Ivan Novick wrote:
Given a time_t value, if you wanted to print the time in a specific
timezone, is there a better way then what I am currently doing which
seems really bad?

Currently I set the TZ system environment variable, call tzset, then
use localtime to create a struct tm.

This process is slow to execute and also has issues with multiple
threads all setting the single TZ variable.

I would appreciate any leads.

I don't think there is anything available in Standard C++. Have you
tried looking in the manual for your OS?
Its redhat linux... basically i think standard c library and c++
library is all that is available, but above technique is the best i can
find.

----
Ivan
http://www.0x4849.net

Dec 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.