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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: function Clock return Time; Time is a number, a string...? Reply-To: anon@anon.org (anon) References: <1194388351.937058.41110@k79g2000hse.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Tue, 06 Nov 2007 23:21:53 GMT NNTP-Posting-Host: 12.65.96.211 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1194391313 12.65.96.211 (Tue, 06 Nov 2007 23:21:53 GMT) NNTP-Posting-Date: Tue, 06 Nov 2007 23:21:53 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:18217 Date: 2007-11-06T23:21:53+00:00 List-Id: In Ada it is a private maybe numeric type or it could be something else and in the Ada.Calendar package their are other routines that convert this private type to other type that a program can use. To use: -- -- tt.adb -- with Ada.Calendar ; use Ada.Calendar ; with Text_IO ; use Text_IO ; with Ada.Integer_Text_IO ; use Ada.Integer_Text_IO ; procedure tt is Clock_Value : Time := Clock ; begin Put ( "Date => " ) ; Put ( Year ( Clock_Value ), 4 ) ; Put ( '/' ) ; if Month ( Clock_Value ) < 10 then Put ( '0' ) ; end if ; Put ( Month ( Clock_Value ), 1 ) ; Put ( '/' ) ; if Day ( Clock_Value ) < 10 then Put ( '0' ) ; end if ; Put ( Day ( Clock_Value ), 1 ) ; New_Line ; end ; In <1194388351.937058.41110@k79g2000hse.googlegroups.com>, j.khaldi@oltrelinux.com writes: >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 >