Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix and the year 2036 3

Status
Not open for further replies.

NuniPR

Programmer
Mar 3, 2005
55
PR
Hi Guys!!

I need some information regarding an error I've been hearing about Unix and the year 2036. According to everything I've been reading, there'll be a problem with the OS in year 2036, when the date/time on Jan 19 2036 will change to Dec 13 1901.

Does anyone know about this issue? What can we do to solve it or at least be prepared for it?

Thanks again for your help.



Nunina [gorgeous]
Cognos BI Administrator
San Juan, PR
 
Sambones,

I think your right about Oracle. Progress is the same, and both languages are quite similar.

JP
 
Hi,

Oracle is quiet for that problem.
Here is a sample sql to convert '14-MAR-2050 10:38:39' to epoch :

Code:
SELECT
86400 * ( TO_DATE ( '14-MAR-2050 10:38:39', 'DD-MON-YYYY HH24:MI:SS' ) - TO_DATE ('01-JAN-1970', 'DD-MON-YYYY'))
FROM DUAL

Result : 2530867119


Here is a sample sql for Oracle to convert back the epoch to original date :

Code:
SELECT
TO_CHAR(TO_DATE('01-JAN-1970')+2530867119/86400,'DD-MON-YYYY HH24:MI:SS')
FROM DUAL 

Result : 14-MAR-2050 10:38:39
 
Very interesting thread, I thought back 30 years, to what I was doing then and figured climbing trees and being nearly 8 didn't count.

Any heads up on how I can make phat bucks from this in 30 years (as I'll probably not be retiring until I'm dead) will help immensley :)

All of our current RH 7.3/8.0/9.0 ES2.1/3/4 on compaqs give the same results.
Code:
2147483641      Tue Jan 19 03:14:01 2038
2147483642      Tue Jan 19 03:14:02 2038
2147483643      Tue Jan 19 03:14:03 2038
2147483644      Tue Jan 19 03:14:04 2038
2147483645      Tue Jan 19 03:14:05 2038
2147483646      Tue Jan 19 03:14:06 2038
2147483647      Tue Jan 19 03:14:07 2038
2147483648      Fri Dec 13 20:45:52 1901
2147483649      Fri Dec 13 20:45:52 1901
2147483650      Fri Dec 13 20:45:52 1901

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Hi,

Here is the latest investigation using C on AIX 5.2 Kernel 32bits on 64bits hardware.

Code:
#cat z2038.c
#include <time.h>
int main (int argc, char **argv)
{
        time_t t;
        t = (time_t) 2147483647;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
        t+=1;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
        t+=2147483647;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
        t+=2147483647;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
        t+=2147483647;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
        t+=2147483647;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
        t+=2147483647;
        printf ("%+.10d\t%s", (int) t, asctime (gmtime (&t)));
}
#

Compiling with gcc 3.3.2 using 32bit and 64bit swithes

Code:
#
#gcc -o z2038_32 -maix32 z2038.c
#file ./z2038_32
./z2038_32: executable (RISC System/6000) or object module not stripped   

#gcc -o z2038_64 -maix64 z2038.c
#file ./z2038_64
./z2038_64: 64-bit XCOFF executable or object module not stripped 

#

executing the 32bit version

Code:
#./z2038_32
+2147483647     Tue Jan 19 03:14:07 2038
-2147483648     Fri Dec 13 20:45:52 1901
-0000000001     Wed Dec 31 23:59:59 1969
+2147483646     Tue Jan 19 03:14:06 2038
-0000000003     Wed Dec 31 23:59:57 1969
+2147483644     Tue Jan 19 03:14:04 2038
-0000000005     Wed Dec 31 23:59:55 1969
#

executing the 64bit version

Code:
#./z2038_64
+2147483647     Tue Jan 19 03:14:07 2038
-2147483648     Tue Jan 19 03:14:08 2038
-0000000001     Sun Feb  7 06:28:15 2106
+2147483646     Fri Feb 25 09:42:22 2174
-0000000003     Wed Mar 16 12:56:29 2242
+2147483644     Mon Apr  4 16:10:36 2310
-0000000005     Sat Apr 22 19:24:43 2378
#


 
It was a quiet afternoon so I took my playbox (IBM RS6000 270-44P) reinstalled vanilla AIX 5.1 ML9 and ran
Code:
# date 011821012038
# while [ 1 ] 
> do
>   date
>   sleep 60
> done
Mon Jan 18 21:01:37 CST 2038
Mon Jan 18 21:02:37 CST 2038
Mon Jan 18 21:03:37 CST 2038
Mon Jan 18 21:04:37 CST 2038
Mon Jan 18 21:05:37 CST 2038
Mon Jan 18 21:06:37 CST 2038
Mon Jan 18 21:07:37 CST 2038
Mon Jan 18 21:08:37 CST 2038
Mon Jan 18 21:09:37 CST 2038
Mon Jan 18 21:10:37 CST 2038
Mon Jan 18 21:11:37 CST 2038
Mon Jan 18 21:12:37 CST 2038
Mon Jan 18 21:13:37 CST 2038
and it just stopped dead.
After the reboot
Code:
# date
Wed Dec 31 18:02:14 CST 1969
which is about what was expected.

So, assuming this box is still running in 2038 and I'm still running AIX 5.1 ML9 I'll have problems.

Columb Healy
 
Good thread.


I guess I'll start investing more...so I can retire early. I don't want to deal with this. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top