From: anon@anon.org (anon)
Subject: Re: function Clock return Time; Time is a number, a string...?
Date: Tue, 06 Nov 2007 23:21:53 GMT
Date: 2007-11-06T23:21:53+00:00 [thread overview]
Message-ID: <lG6Yi.59145$kj1.35931@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1194388351.937058.41110@k79g2000hse.googlegroups.com
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
>
next prev parent reply other threads:[~2007-11-06 23:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-06 22:32 function Clock return Time; Time is a number, a string...? j.khaldi
2007-11-06 23:21 ` anon [this message]
2007-11-07 0:15 ` Jeffrey Creem
2007-11-07 10:49 ` Georg Bauhaus
2007-11-07 10:56 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox