The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Funny but true.... naushad UNIX for Dummies Questions & Answers 6 03-26-2008 03:23 AM
how to exit a while true loop Noob e Shell Programming and Scripting 5 08-26-2007 11:44 AM
why isn't the exit status true? mjays Shell Programming and Scripting 5 04-04-2007 06:18 AM
True Shutdown help! 01000101 UNIX for Dummies Questions & Answers 3 05-15-2006 04:36 PM
ksh [ HP True 64 v5.1 ] and HP-UX B.11.11i krishna Shell Programming and Scripting 3 12-19-2005 01:47 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 08-15-2007
Registered User
 

Join Date: Aug 2007
Posts: 7
Lightbulb is it true or not

I have heard for a long time that in maybe 2039 Unix will no longer be useable due the length of the date value. Anyone know anything about this?
Reply With Quote
Forum Sponsor
  #2  
Old 08-15-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
This is down to the time_t type being 32 bits on 32 bit machines.

It measures time in seconds from the start of the epoch, 1st Jan 1970.

So 64 bit machines are not affected, you need to confirm how file systems store dates. There needs to be a binary level change to make time_t a "long long" or a 64 bit number.
Reply With Quote
  #3  
Old 08-15-2007
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,275
For 32 bit time_t values
Code:
#include <time.h>

int main()
{
    time_t lt=0x7fffffff;
	
    printf(asctime(localtime(&lt)));
    return 0;
}
produces this value:

Mon Jan 18 20:14:07 2038

If you add one second to that lt variable the result on my HPUX box is:

Fri Dec 13 13:45:52 1901 -- a time in the past
Reply With Quote
  #4  
Old 08-15-2007
Registered User
 

Join Date: Oct 2004
Posts: 235
Hi Jim ..

That is great i made thi is my unix Hp machine and executed
#include <time.h>

int main()
{
time_t lt=0x7fffffff;

printf(asctime(localtime(&lt)));

printf(asctime(localtime(&lt) + 1 ));

return 0;
}


i got the result as
Mon Jan 18 22:14:07 2038
and
Sun Jan 0 00:00:00 1900

what is

time_t lt=0x7fffffff;

please explain ..

Thanks in advance,
Arun .
Reply With Quote
  #5  
Old 08-16-2007
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,275
It's hex for the largest positive number a signed 32bit number can represent. -- sort of the end of time for 32 bit time_t numbers

2147483647
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0