× 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 may not be as easy as changing to unsigned as negative values have
meaning.  If you call a function such as ctime() passing a negative value
you will receive in some implementations a date prior to 1970 (-100000 for
instance is Tue Dec 30 20:13:20 1969) so you may find various library
functions not working exactly as expected...  and most developers using
time_t would probably also be using the C runtime library.



                                                                           
             Scott Klement                                                 
             <rpg400-l@scottkl                                             
             ement.com>                                                 To 
             Sent by:                  RPG programming on the AS400 /      
             rpg400-l-bounces@         iSeries <rpg400-l@xxxxxxxxxxxx>     
             midrange.com                                               cc 
                                                                           
                                                                   Subject 
             01/12/2005 11:05          RE: Date field's and their file     
             AM                        space usage.                        
                                                                           
                                                                           
             Please respond to                                             
              RPG programming                                              
              on the AS400 /                                               
                  iSeries                                                  
                                                                           
                                                                           




>
> Just wait until 2039 when the the unix timer variable overflows.  Plenty
of
> work to do to handle that.
>

First of all, the problem will occur early in 2038, not in 2039.

And not just on Unix...  This will affect OS/400 and Windows as well.  For
example, the dates/times in the IFS are all stored using a 32-bit integer.
Many of the router & firewall boxes used in networking use these as well.
I imagine there are tons of other electronics with this logic embedded in
them.

I've got lots of RPG programs that use this logic, so it's not limited to
C.  Some of them have been written within the past week!

FWIW, the problem isn't as difficult to fix as it sounds. All you have to
do is switch to use an unsigned integer to store your timestamp and you'll
postpone the problem until 2106. Since, bitwise, any value from 1970 -
2037 will be identical in a signed and unsigned integer, the routines can
be kept backward compable with ease.

Obviously, it's a good practice to store your dates & times in a format
that will last longer, like using a separate integer for date from the one
for time.  Or using a character field, like we typically do...


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.