Changing AIX system date


 
Thread Tools Search this Thread
Operating Systems AIX Changing AIX system date
# 1  
Old 03-05-2010
Question Changing AIX system date

Hi,

Experts,

I required your help to change my system date from year 2010 to 2064. The change is required to perform some testing by our dba's and apllication developers. Through smit i am anable to chage the date and received error. I knew that AIX 5.3 TL8 system date is till year 2037
Is their any other trick to change the system date

Regards,
# 2  
Old 03-05-2010
Write a new version of date, and put it in a test directory, change the path statement so that the test directory is ahead of the OS version of date.
The new version of date should call the OS version, and add 54 years to the year.
# 3  
Old 03-05-2010
The date command can be supplanted with your own time command, but the (signed) 32 bit seconds since epoch will still roll sometime in the 2030's.

So any application that asks the kernel for seconds since epoch (using the *standard* functions) will break using a date like 2050.

The difference here, is that one method is a binary the other is an API.

On the other hand, both java and Oracle can handle dates *much* greater or less than the Unix system time. Java uses its own Olsen DB, and can calculate dates accurately for centuries even covering historical time shifts to fix inaccuracies in medieval calendars.

So if you wanted to see how your app will run in 2050, you may have some problems with current Unix implementations of time(). If you want to calculate amatorizations (as an example) to the year 2050, this should be no issue (and not require a call to time()).

Last edited by wfavorite; 03-05-2010 at 10:17 AM.. Reason: clarification
# 4  
Old 03-05-2010
Has this Y2K+37 problem been solved in 64 bit versions of Linux?
# 5  
Old 03-05-2010
The problem is that we have been trained to use time(); and its accompanying functions for so long that virtually all code uses it, and expects to see a 32bit signed value in return (return and pass by reference).

As for Linux... I would bet money that time() still returns a 32 bit signed value. As I recall, Linux has at least two timers - but it has been some time since I checked - and I did not investigate deeply.

All Unices now offer higher granularity APIs for time, but time() is the workhorse for the large majority of simple time-stamping or finding out where we are chronologically.

I am 99% sure that AIX keeps its epoch time internally in a 32 bit signed value. The kernel variable "time" and "l_bolt" are both of type time_t which is still a typedef of 32bit signed value.

---

The issue here is *why* we are using time(). It is appropriate for timestamps and such... but it is a BAD choice for any type of mathematical function (the example I used was calculating amatorizations (pardon my spellcheck)). If used for an application timestamp is works just peachy right up until 2038. If used as a mathematical calculation of dates it fails on any decently forward looking problem. For this reason (as an example Oracle and Java) development languages / environments can calculate WELL into the future or past.
# 6  
Old 03-06-2010
You probably know about this already:

Year 2038 problem - Wikipedia, the free encyclopedia


Suggest you approach the manufacturer.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies

2. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

3. UNIX for Beginners Questions & Answers

Changing CSV files with date . Subtracting date by values

Hi All, I have a CSV file which is as below. Basically I need to take the year column in it and find if the year is >= 20152 . If that is then I should subtract all values by 6. In the below example in description I am having number mentioned as YYWW so I need to subtract those by -5. Whereever... (8 Replies)
Discussion started by: arunkumar_mca
8 Replies

4. Shell Programming and Scripting

changing date to resemble "messages file" date

the following was taken from a perl script: my $date = strftime "%B %d %H:%M:%S", localtime; how can i modify it so this date outputs the date in the form of the date of the messages file. for example: Sep 20 11:48:44 As it is right now, the perl script outputs the date like this: ... (1 Reply)
Discussion started by: SkySmart
1 Replies

5. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

6. Shell Programming and Scripting

how to get what date was 28 days ago of the current system date IN UNIX

Hi, Anybody knows how to get what date was 28 days ago of the current system date through UNIX script. Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy
15 Replies

7. AIX

changing values for nfs shared file system on aix

Hi, I want to change the values for shared file system in aix for that I have run the command smitty chnfsexp but I am not getting the all the values which I have seen while adding the file system while exporting example smitty chnfsexp but after selecting shared file system using F4... (3 Replies)
Discussion started by: manoj.solaris
3 Replies

8. Shell Programming and Scripting

Compare date from db2 table to yesterday's Unix system date

I am currently running the following Korn shell script which works fine: #!/usr/bin/ksh count=`db2 -x "select count(*) from schema.tablename"` echo "count" I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies

9. AIX

Command for changing date in IBM AIX

Hello everybody, plz tell me the command for chaging the date paramater in IBM AIX.. (3 Replies)
Discussion started by: oracle_rajesh_k
3 Replies

10. UNIX for Dummies Questions & Answers

Changing Creation Date to a Prespecified Date of a File In Unix

Dear Expert, Is there a command to do that in Unix? In such a way that we don't need to actually "write" or modified the content. -- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies
Login or Register to Ask a Question