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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ad75eb44c73d85f X-Google-Attributes: gid103376,public From: Jerome Desquilbet Subject: Re: simple time display Date: 1997/01/16 Message-ID: <32DE4203.2781@Rational.COM>#1/1 X-Deja-AN: 210236657 references: <32DCD770.60BB29B1@3wis.nl> to: Noam Kloos content-type: text/plain; charset=us-ascii organization: Rational Software Corporation in (the) SQY, France mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (X11; I; OSF1 V3.2 alpha) Date: 1997-01-16T00:00:00+00:00 List-Id: > What whould be the simplest way to just pprint the current time in > ada? My previous message just explained how to print a Duration object. If you want to print the current time, you have to use Ada.Calendar. For example: with Ada.Text_Io; use Ada.Text_Io; with Ada.Calendar; use Ada.Calendar; procedure Print_Current_Date is Current_Time : Time := Clock; Current_Year : Year_Number := Year (Current_Time); Current_Month : Month_Number := Month (Current_Time); Current_Day : Day_Number := Day (Current_Time); begin Put_Line (Year_Number'Image (Current_Year) & Month_Number'Image (Current_Month) & Day_Number'Image (Current_Day)); end Print_Current_Date;