comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Calendar.Formatting.Image
@ 2007-06-13 23:19 Jeffrey R. Carter
  2007-06-14  5:33 ` AW: Ada.Calendar.Formatting.Image Grein, Christoph (Fa. ESG)
  0 siblings, 1 reply; 9+ messages in thread
From: Jeffrey R. Carter @ 2007-06-13 23:19 UTC (permalink / raw)


Here's a little test program:

with Ada.Calendar.Formatting;
with Ada.Text_IO;

procedure Time_Test is
    Time : constant Ada.Calendar.Time := Ada.Calendar.Clock;

    Year    : Positive;
    Month   : Positive;
    Day     : Positive;
    Hour    : Natural;
    Minute  : Natural;
    Second  : Natural;
    Sub_Sec : Duration;
    Seconds : Duration;
begin -- Time_Test
    Ada.Calendar.Split (Date    => Time,
                        Year    => Year,
                        Month   => Month,
                        Day     => Day,
                        Seconds => Seconds);
    Ada.Calendar.Formatting.Split (Seconds    => Seconds,
                                   Hour       => Hour,
                                   Minute     => Minute,
                                   Second     => Second,
                                   Sub_Second => Sub_Sec);
    Ada.Text_IO.Put_Line (Item => Integer'Image (Year)   &
                                  Integer'Image (Month)  &
                                  Integer'Image (Day)    &
                                  Integer'Image (Hour)   &
                                  Integer'Image (Minute) &
                                  Integer'Image (Second) &
                                  Duration'Image (Sub_Sec) );
    Ada.Text_IO.Put_Line (Item => Ada.Calendar.Formatting.Image (Time) );
end Time_Test;

Using GNAT GPL 2007 on a Linux/x86 platform with system time set to MST 
(-0700), this outputs

  2007 6 13 15 46 20 0.415945000
2007-06-13 22:45:57

Is the ~23 sec difference correct, or is this an error in Image?

-- 
Jeff Carter
"Sir Robin the-not-quite-so-brave-as-Sir-Lancelot,
who had nearly fought the Dragon of Angnor,
who nearly stood up to the vicious Chicken of Bristol,
and who had personally wet himself at the
Battle of Badon Hill."
Monty Python & the Holy Grail
68



^ permalink raw reply	[flat|nested] 9+ messages in thread

* AW: Ada.Calendar.Formatting.Image
  2007-06-13 23:19 Ada.Calendar.Formatting.Image Jeffrey R. Carter
@ 2007-06-14  5:33 ` Grein, Christoph (Fa. ESG)
  2007-06-14 16:53   ` tmoran
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Grein, Christoph (Fa. ESG) @ 2007-06-14  5:33 UTC (permalink / raw)
  To: comp.lang.ada

I get the same difference with GNAT Pro 6.0.1:

Time_Offset 120
2007 6 14 7 28 22 0.206127000
2007-06-14 05:27:59.21
2007-06-14 07:27:59.21


Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt

CONFIDENTIALITY NOTICE 

This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* AW: Ada.Calendar.Formatting.Image
  2007-06-14  5:33 ` AW: Ada.Calendar.Formatting.Image Grein, Christoph (Fa. ESG)
@ 2007-06-14 16:53   ` tmoran
  2007-06-15  4:36     ` Jeffrey R. Carter
  2007-06-15  4:37     ` Grein, Christoph (Fa. ESG)
  2007-06-14 21:49   ` Per Sandberg
  2007-06-15  4:37   ` Jeffrey R. Carter
  2 siblings, 2 replies; 9+ messages in thread
From: tmoran @ 2007-06-14 16:53 UTC (permalink / raw)


> 2007 6 14 7 28 22 0.206127000
> 2007-06-14 05:27:59.21

Possibly relevant fact:
If the clock tick is 10E-11, then 2**32 ticks would be about 23 seconds.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AW: Ada.Calendar.Formatting.Image
  2007-06-14  5:33 ` AW: Ada.Calendar.Formatting.Image Grein, Christoph (Fa. ESG)
  2007-06-14 16:53   ` tmoran
@ 2007-06-14 21:49   ` Per Sandberg
  2007-06-15  4:37   ` Jeffrey R. Carter
  2 siblings, 0 replies; 9+ messages in thread
From: Per Sandberg @ 2007-06-14 21:49 UTC (permalink / raw)


Have you sent a note to AdaCore??
/Per

Grein, Christoph (Fa. ESG) wrote:
> I get the same difference with GNAT Pro 6.0.1:
> 
> Time_Offset 120
> 2007 6 14 7 28 22 0.206127000
> 2007-06-14 05:27:59.21
> 2007-06-14 07:27:59.21
> 
> 
> Eurocopter Deutschland GmbH
> Sitz der Gesellschaft/Registered Office: Donauwoerth
> Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
> Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
> Geschaeftsfuehrung/Board of Management:
> Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt
> 
> CONFIDENTIALITY NOTICE 
> 
> This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
> If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
> It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AW: Ada.Calendar.Formatting.Image
  2007-06-14 16:53   ` tmoran
@ 2007-06-15  4:36     ` Jeffrey R. Carter
  2007-06-15  5:46       ` AW: " Grein, Christoph (Fa. ESG)
  2007-06-15  4:37     ` Grein, Christoph (Fa. ESG)
  1 sibling, 1 reply; 9+ messages in thread
From: Jeffrey R. Carter @ 2007-06-15  4:36 UTC (permalink / raw)


tmoran@acm.org wrote:
>> 2007 6 14 7 28 22 0.206127000
>> 2007-06-14 05:27:59.21
> 
> Possibly relevant fact:
> If the clock tick is 10E-11, then 2**32 ticks would be about 23 seconds.

That doesn't seem relevant here. The difference is the values obtained 
using Split and Image for the same Clock value.

-- 
Jeff Carter
"You tiny-brained wipers of other people's bottoms!"
Monty Python & the Holy Grail
18



^ permalink raw reply	[flat|nested] 9+ messages in thread

* AW: Ada.Calendar.Formatting.Image
  2007-06-14 16:53   ` tmoran
  2007-06-15  4:36     ` Jeffrey R. Carter
@ 2007-06-15  4:37     ` Grein, Christoph (Fa. ESG)
  1 sibling, 0 replies; 9+ messages in thread
From: Grein, Christoph (Fa. ESG) @ 2007-06-15  4:37 UTC (permalink / raw)
  To: comp.lang.ada

No, it's the number of leap seconds since 1972. See Ada.Calendar body.


Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt

CONFIDENTIALITY NOTICE 

This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: AW: Ada.Calendar.Formatting.Image
  2007-06-14  5:33 ` AW: Ada.Calendar.Formatting.Image Grein, Christoph (Fa. ESG)
  2007-06-14 16:53   ` tmoran
  2007-06-14 21:49   ` Per Sandberg
@ 2007-06-15  4:37   ` Jeffrey R. Carter
  2 siblings, 0 replies; 9+ messages in thread
From: Jeffrey R. Carter @ 2007-06-15  4:37 UTC (permalink / raw)


Grein, Christoph (Fa. ESG) wrote:
> I get the same difference with GNAT Pro 6.0.1:
> 
> Time_Offset 120
> 2007 6 14 7 28 22 0.206127000
> 2007-06-14 05:27:59.21
> 2007-06-14 07:27:59.21

Interesting. As a supported user, perhaps you could inquire of AdaCore 
about this.

-- 
Jeff Carter
"You tiny-brained wipers of other people's bottoms!"
Monty Python & the Holy Grail
18



^ permalink raw reply	[flat|nested] 9+ messages in thread

* AW: AW: Ada.Calendar.Formatting.Image
  2007-06-15  4:36     ` Jeffrey R. Carter
@ 2007-06-15  5:46       ` Grein, Christoph (Fa. ESG)
  0 siblings, 0 replies; 9+ messages in thread
From: Grein, Christoph (Fa. ESG) @ 2007-06-15  5:46 UTC (permalink / raw)
  To: comp.lang.ada

I did send this to AdaCore (normally, I do not spill their mailbox with
CLA questions, but here I was concerned about our time measurements
we'll perform pretty soon).

With the newest supported version GNAT Pro 6.0.1, this does not occur (I
was wrong in my first post, this was with a previous version). In
package Calendar body, there is a constant Leap_Support, and if this is
False, you don't the 23 s difference caused by the number of leap
seconds since 1972.

Leap_Second_Dates: constant array (1 .. Leap_Seconds_Count) of
Leap_Second_Date :=
      ((1972,  6, 30), (1972, 12, 31), (1973, 12, 31), (1974, 12, 31),
       (1975, 12, 31), (1976, 12, 31), (1977, 12, 31), (1978, 12, 31),
       (1979, 12, 31), (1981,  6, 30), (1982,  6, 30), (1983,  6, 30),
       (1985,  6, 30), (1987, 12, 31), (1989, 12, 31), (1990, 12, 31),
       (1992,  6, 30), (1993,  6, 30), (1994,  6, 30), (1995, 12, 31),
       (1997,  6, 30), (1998, 12, 31), (2005, 12, 31));


Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt

CONFIDENTIALITY NOTICE 

This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* AW: Ada.Calendar.Formatting.Image
       [not found] <0367891DA5DA7E408D42A860FA002F448D62CA@sma2901.cr.eurocopter.corp>
@ 2007-06-15  8:12 ` Grein, Christoph (Fa. ESG)
  0 siblings, 0 replies; 9+ messages in thread
From: Grein, Christoph (Fa. ESG) @ 2007-06-15  8:12 UTC (permalink / raw)
  To: comp.lang.ada


With the newest supported version GNAT Pro 6.0.1, this does not occur.
In
package Calendar body, there is a constant Leap_Support, and if this is
False, you don't GET the 23 s difference caused by the number of leap
seconds since 1972.

(Oops: Forgot GET in last message.)


Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt

CONFIDENTIALITY NOTICE 

This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-06-15  8:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-13 23:19 Ada.Calendar.Formatting.Image Jeffrey R. Carter
2007-06-14  5:33 ` AW: Ada.Calendar.Formatting.Image Grein, Christoph (Fa. ESG)
2007-06-14 16:53   ` tmoran
2007-06-15  4:36     ` Jeffrey R. Carter
2007-06-15  5:46       ` AW: " Grein, Christoph (Fa. ESG)
2007-06-15  4:37     ` Grein, Christoph (Fa. ESG)
2007-06-14 21:49   ` Per Sandberg
2007-06-15  4:37   ` Jeffrey R. Carter
     [not found] <0367891DA5DA7E408D42A860FA002F448D62CA@sma2901.cr.eurocopter.corp>
2007-06-15  8:12 ` Grein, Christoph (Fa. ESG)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox