From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A8CA7BB81 for ; Fri, 24 Dec 2004 12:19:28 +0100 (CET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBOBJQ1v004056 for ; Fri, 24 Dec 2004 12:19:27 +0100 Received: from [192.168.1.200] (ppp194-89.lns1.syd2.internode.on.net [203.122.194.89]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iBOBJDRF022375; Fri, 24 Dec 2004 21:49:15 +1030 (CST) Subject: Re: [Caml-list] .- From: skaller Reply-To: skaller@users.sourceforge.net To: Anastasia Gornostaeva Cc: Caml-list@yquem.inria.fr In-Reply-To: <20041224100422.GA10012@ermine.home> References: <20041224100422.GA10012@ermine.home> Content-Type: text/plain Organization: Message-Id: <1103887152.6201.80.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 24 Dec 2004 22:19:12 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41CBFB3E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 printf:01 printf:01 glebe:01 061:98 unix:01 nsw:01 curr:01 curr:01 diff:01 diff:01 snail:02 2037:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Fri, 2004-12-24 at 21:04, Anastasia Gornostaeva wrote: > Hello. > > open Unix > > let _ = > let curr_time = time () in > let curr_tm = gmtime curr_time in > let new_time, _ = mktime {curr_tm with tm_hour = curr_tm.tm_hour+1} in > let diff = new_time -. curr_time in > Printf.printf "%f\n%f\n%f\n" > curr_time > new_time > diff > > > gives an negative result -7200.000000. Why? Because you live in Russia not London. gmtime is adjusting for your timezone. Instead of 1 hour, you're getting -2 hours. So I am going to guess you live in a GMT+3 hour timezone .. so that's Western Russia, perhaps Moscow? -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net