From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fa528,9c72276605786834,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-04-06 02:45:02 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!195.25.12.36.MISMATCH!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: francois reygagne Newsgroups: comp.unix.tru64 Subject: Convert local time to gmt time without using TimeZone Env variable Date: Fri, 06 Apr 2001 11:40:09 +0200 Organization: opteway Message-ID: <3ACD8EF9.221E5F8F@opteway.com> NNTP-Posting-Host: sophia1.opteway.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.read.news.oleane.net 986550009 2452 195.101.210.209 (6 Apr 2001 09:40:09 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 6 Apr 2001 09:40:09 +0000 (UTC) X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.4.2 i686) X-Accept-Language: en Xref: supernews.google.com comp.unix.tru64:2036 The ftcs unix mktime use the function tzset to initialize time conversion information by setting an environment variable. That is not thread-safe. As I want to work in multi_threaded design with different time-zone, one per each thread, I can't use the unix standard fonctions like mktime. I need a thread-safe function that converts a local-time attached to its timezone into a GMT time as follow: void localtime_to_gmt(const char * timezone, const struct tm localtime, time_t * gmt_time); Is there a sofftware which uses instead of TZ env variable a local time zone variable attached to the process to convert a local time to GMT ? Thanks for your help ? Fran�ois REYGAGNE. Software Architect. opt[e]way S.A., 2881 route des Cr�tes, BP308 06906 Sophia Antipolis Cedex, FRANCE t�l: +33 (0)4 92 95 27 01 http://www.opteway.com