is it true or not


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers is it true or not
# 1  
Old 08-15-2007
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?
# 2  
Old 08-15-2007
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.
# 3  
Old 08-15-2007
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
# 4  
Old 08-16-2007
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 .
# 5  
Old 08-16-2007
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

While true loop stopped

Hello Team, In my shell script, it stopped without killing it. Could you please help why ? Below is the code : get_dpi44_currentFiles() { truncate --size 0 $dpi_44_fixed_currentFileList if ssh $dpi_srvr_44 -p 2222 "ls $dpi_44_sourceFilesDir/fixed | grep '\.tgz$'" >... (5 Replies)
Discussion started by: sadique.manzar
5 Replies

2. Shell Programming and Scripting

Explaination on if true

Hi Team, I need to know why ppl use If true loop instead of just writing down the sequence of code lines. 1: echo "Line1" if true; then echo "Line2" fi echo "Line3" 2: echo "Line1" echo "Line2" echo "Line3" Could you explain what does the if true loop make difference in 1st compare... (3 Replies)
Discussion started by: chandana hs
3 Replies

3. Shell Programming and Scripting

While loop true problem

hi, i am new in bash scripting. i am trying to write a Bash script to monitor how many process are running in my Redhat6 Linux machine. example : let say there must be always 5 process from the same kind that must run and if one off them fails down the script must wake up another process... (2 Replies)
Discussion started by: zigizag
2 Replies

4. Shell Programming and Scripting

loop until true

Hi I need help with a script to loop unitl the statement is true done some thing like this until if then cp filename filename.anto fi done Regards, (3 Replies)
Discussion started by: antointoronto
3 Replies

5. UNIX for Dummies Questions & Answers

Funny but true....

Hallo everybody I am having a shell script called auto_run.sh in that only the first line works. the second line which has sed command is working only at the # prompt. not within the shell script. What could be the reason. *... sed 's/ //g' KTI >abc works in another shell script without the... (6 Replies)
Discussion started by: naushad
6 Replies

6. Shell Programming and Scripting

how to exit a while true loop

Hi guys, I'm new to unix but loving it!! BUT this is driving me nuts as i can't work out the best way to do it. I have a while true loop that i use to monitor something. For my own reasons in ths script i have disabled the CTRL C using the trap command. But i want to put in a option to exit... (5 Replies)
Discussion started by: Noob e
5 Replies

7. UNIX for Dummies Questions & Answers

True Shutdown help!

ok, i know the syntax that goes along with the Shutdown command... but my box never wants to ... well... shutdown.. it only halts, kills all the process's, stalls the comp to a complete stop, but does actually kill the monitor and/or shut off the physical computer. it will reboot properly though,... (3 Replies)
Discussion started by: 01000101
3 Replies

8. Shell Programming and Scripting

ksh [ HP True 64 v5.1 ] and HP-UX B.11.11i

Hi Friends, We have migrated our Unix from HP True 64 v5.1 to HP-UX B.11.11i recently and copied all my shell scripts ( Korn shell ) to new HP-UX B.11.11i unix machine. I've encountered lot of errors during execution of the scripts for example: cat x.sh #!/usr/bin/ksh if then echo... (3 Replies)
Discussion started by: krishna
3 Replies

9. Programming

C++ on True Unix Platform

Hi all: I would like to get some details about development using C++ on TRUE Unix platform. Can anyone help me ?? Thanks, -Mandar (2 Replies)
Discussion started by: mandar3
2 Replies
Login or Register to Ask a Question