From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8c2975e461a425 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!out04b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny09.POSTED!c9e1c1fe!not-for-mail From: Jeffrey Creem User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: function Clock return Time; Time is a number, a string...? References: <1194388351.937058.41110@k79g2000hse.googlegroups.com> In-Reply-To: <1194388351.937058.41110@k79g2000hse.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 07 Nov 2007 00:15:06 GMT NNTP-Posting-Host: 71.168.122.204 X-Complaints-To: abuse@verizon.net X-Trace: trndny09 1194394506 71.168.122.204 (Tue, 06 Nov 2007 19:15:06 EST) NNTP-Posting-Date: Tue, 06 Nov 2007 19:15:06 EST Xref: g2news1.google.com comp.lang.ada:18218 Date: 2007-11-07T00:15:06+00:00 List-Id: j.khaldi@oltrelinux.com wrote: > In "package Ada.Calendar".. > function Clock return Time; // what is the type of Time here? > A string? A number? Something else? > "Time" has been declarated "private", this means it is untyped yet; > In other words, if I had to call the the function Year with the > argument Date, how should I do: > Date := The_Date; // for example: 11 dicember 2004 > GetYear := Year(Date); > Thanks! > > Jilani > It is private and you don't get to know and any code you write that attempts to guess will almost certainly break. If you need to do what you are asking you need to use the other subprograms in calendar to build a time value based on non private items. In your case date := Ada.Calendar.Time_Of(year => 2004, Month => 12, Day => 11);