× 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.



>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




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.