printing times in specific timezones

I

Ivan Novick

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,
 
V

Victor Bazarov

Ivan said:
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
 
I

Ivan Novick

Victor said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top