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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,aa60d56d22a287d1 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!g38g2000yqd.googlegroups.com!not-for-mail From: reinkor Newsgroups: comp.lang.ada Subject: Re: Newbie Q: How to program in UTC (time/calendar) ? Date: Fri, 27 Mar 2009 05:52:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7f003dc4-3c3c-4e47-8ddf-d5001b310c17@g38g2000yqd.googlegroups.com> References: NNTP-Posting-Host: 193.156.99.217 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1238158337 25602 127.0.0.1 (27 Mar 2009 12:52:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 27 Mar 2009 12:52:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g38g2000yqd.googlegroups.com; posting-host=193.156.99.217; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.64 (X11; Linux x86_64; U; en) Presto/2.1.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:4368 Date: 2009-03-27T05:52:15-07:00 List-Id: Given the following Ada code: with Text_IO,Ada.Calendar,Ada.Calendar.Formatting; use Text_IO,Ada.Calendar,Ada.Calendar.Formatting; procedure t1 is package Int_Io is new Text_IO.Integer_Io (Integer); use Int_Io; Time1 : Time; begin Time1 := Value("1970-01-01 00:00:00"); Put(Image(Time1));New_Line; Put(Image(Ada.Calendar.Time_Of(1970,1,1,Duration(0)))); end t1; This gives (on my linux computer): 1970-01-01 00:00:00 1969-12-31 23:00:00 The last output line here reflects the fact that Ada takes "local time" from the computer - and the result would be different if I wait to run my program till next Monday (this weekend we change to summer daylight saving time). I would expect that time zones should be explicite - and this would help programmers to avoid misstakes (which is an argument for Ada). I made and error due to this my confusion - am I just to much of a newbie ? reinert