From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA07857; Wed, 24 Mar 2004 23:44:37 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA05578 for ; Wed, 24 Mar 2004 23:44:36 +0100 (MET) Received: from grebe.mail.pas.earthlink.net (grebe.mail.pas.earthlink.net [207.217.120.46]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2OMiYHd030200 for ; Wed, 24 Mar 2004 23:44:35 +0100 Received: from user-0cdfqeb.cable.mindspring.com ([24.215.233.203] helo=xp) by grebe.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 1B6H6t-00065Z-00 for caml-list@inria.fr; Wed, 24 Mar 2004 14:44:31 -0800 Message-ID: <007101c411f1$8113de50$6401a8c0@xp> From: "Zeno Lee" To: References: <20040324223416.40978.qmail@web41207.mail.yahoo.com> Subject: Re: [Caml-list] OReilly exercise question Date: Wed, 24 Mar 2004 17:44:01 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; zeno:01 zeno:01 caml-list:01 caml-list:01 2004:99 wire:99 printf:01 eprintf:01 stdout:01 ocamlc:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 355 The exercise is under the assumption that you've already opened the Unix module. try date.Unix.tm_year ----- Original Message ----- From: "Vasili Galchin" To: Sent: Wednesday, March 24, 2004 5:34 PM Subject: [Caml-list] OReilly exercise question > Hello > > I am working some of the exercises in the online > OReilly book, in particular the time server in the > Distributed Computing chapter. I wrote the following > function: > > (* Get time of day and send across the wire *) > let time_service ic oc = > try > let ts = Unix.time () in > let (date:Unix.tm) = Unix.gmtime ts in > let year = string_of_int (date.tm_year); > month = string_of_int (date.tm_mon + 1); > day = string_of_int (date.tm_mday); > hour = string_of_int (date.tm_hour); > minute = string_of_int (date.tm_min); > seconds = string_of_int (date.tm_sec) in > let r = year^month^day^hour^minute^seconds > in output_string oc (r^"\n"); flush oc > with _ -> Printf.eprintf "BLAH\n"; flush stdout; > xit 0;; > > > I get the following error from ocamlc: > > File "time1.ml", line 23, characters 30-44: > Unbound record field label tm_year > > I am confused because this field is in Unix.tm! ??? > > Regards, Vasili > > __________________________________ > Do you Yahoo!? > Yahoo! Finance Tax Center - File online. File on time. > http://taxes.yahoo.com/filing.html > > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners