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.9 required=5.0 tests=BAYES_00 autolearn=ham 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: g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!feeder.erje.net!de-l.enfer-du-nord.net!gegeweb.org!aioe.org!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Newbie Q: How to program in UTC (time/calendar) ? Date: Wed, 25 Mar 2009 15:28:08 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: jsj6/wjO/cHSAHkcGxcp1Q.user.aioe.org X-Complaints-To: abuse@aioe.org NNTP-Posting-Date: Wed, 25 Mar 2009 15:28:08 +0000 (UTC) X-Notice: Filtered by postfilter v. 0.7.7 X-Newsreader: Tom's custom newsreader Cancel-Lock: sha1:wk53q7GweoJBJySxUReUo5dMkak= Xref: g2news2.google.com comp.lang.ada:5275 Date: 2009-03-25T15:28:08+00:00 List-Id: >I did hope I could use the Ada calendar routines to process >"historical" data tagged with UTC - independent of where >in the world I run the program. I must have missed where you said what you are doing. If you want to find the time between two events in the same time zone in the historical data, just subtract and get a Duration -- Ada.Calendar.Clock is irrelevant. If you want something like "the historical data says this event happened at 8 am, March 25, 2009, how long ago was that?", and you don't know the UTC time of that recording or the UTC time of "now", you're just out of luck. If you do know both of those. good. >Anyway, when giving an UTC date/time to a computer program, this should >not be affected if the computer change time zone when processing? A >travelling computer may run a program many days and while it is passing >many time zones. Ada.Calendar.Clock can only give your program a reading of the computer's clock. If you keep changing the computer's clock as you travel, you will need to inform the data logging program of each change in UTC offset. The simpler approach would be to set the computer's clock to UTC at the beginning of the trip and not change it as you travel.