Avatar of ajoshi79
ajoshi79
 asked on

Time zone conversion

Hi,

I am working on C++/unix environment and my database is informix.i am taking current time as local time using time(0)function. i wanted to know that is there an API or any time function which will convert this current-local time to any specific time zone. say for example my program is running in Central Time Zone and that gives me localtime which is CST, but i need time in EST.
Or is there any function/API which directy gives me time in any specific time zone. say for example irrespective of local time that gives me time in EST.

thanks.
C++

Avatar of undefined
Last Comment
ajoshi79

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Salte

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
burcarpat

check out

    http://www.boost.org/libs/date_time/doc/index.html

for a peer-reviewed date-time library, supported by many c++ standards committee members via boost.org.  the lib is cross-platform and works with many platforms and compilers w/o any problems and it's 100% free ( i.e. free for commercial use, etc. )

the lib does have local time adjustments support, for docs of that part, see

    http://www.boost.org/libs/date_time/doc/local_time_adjust.html
ajoshi79

ASKER
Thanks for yor valuable suggestions.
It worked the way you suggested.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy