Link to home
Start Free TrialLog in
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.
ASKER CERTIFIED SOLUTION
Avatar of Salte
Salte

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of burcarpat
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
Avatar of ajoshi79

ASKER

Thanks for yor valuable suggestions.
It worked the way you suggested.