× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



 It is only once a year that the time goes backwards, and then it does so
only in places with Daylight Savings Time.   I understood that GMT is a
constant time, not reflecting Daylight Savings Time.   If so, why isn't the
machine set to GMT and timestamps figured from that time, not from the
offset?  Displayed time is subject to location, but what's that got to do
with machine time?


---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@MartinVT.com
---------------------------------------------------------

-------Original Message-------

From: midrange-l@midrange.com
Date: Friday, October 25, 2002 04:43:58 PM
To: midrange-l
Subject: Dealing with changing time

>From the many messages on the problems with changing time (which would

doubtless happen even if you don't observe DST) it is apparent that a
solution is needed. Let's look at the problem:

1. timestamps in database files and logs should always increase
2. users should see time the same way the clock on the wall shows it

These two objectives are seemingly in conflict with each other. Any
method of resolving this conflict would need to both use a constant clock
and a variable clock. I wonder if a solution exists...

Yes, I think one does. The iSeries has both types of clocks: QTIME and
the software clock. An API could be developed that would convert QTIME
data into the current time based on what the software clock thinks is the
real time, and another one to convert it back again.

So let's say that you write a program to keep track of employee's time
cards. Record all times in the DB as QTIME data and do all your math on
that data, but display it on the screen and on reports by taking into
account the software clock. When they punch in you write to the DB
something obtained by doing:

C time timein

where timein is a timestamp field. But when they look on the screen to
see when the clocked in you do something like:

C eval dsplytime = abstime2dsplytime(timein)

where dsplytime is maybe a char field and abstime2dsplytime() converts the
QTIME timestamp timein to the equivalent DST-aware wall clock time using
the software clock. abstime2dsplytime() would probably make use of the
unix APIs to do its conversion.

Any comments on this idea?

James Rich


_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.