Friday, December 5, 2008

What are the Date(s) in a Computer System ?

The term [ Date ] seems to be very simple. Every morning when you wake up, it is a new day with a new date. However, in a computer system, there are many different dates. Here is a brief description of some of the [ dates ].

1. Calendar Date

This is the date related to human being. It is the information got from the paper calendar or from you wrist watch.

2. Business Date

This is also a term related to human being. It refers to those date with business activities.

For many countries, it refers to Monday to Saturday, excluding public holidays. For those 5-day work countries, it refers to Monday to Friday, excluding public holidays.

However, in Israel world, the normal business date is from Sunday to Thursday and Friday morning. So, Sunday is a normal business date.

3. Machine Date / OS Date

This is the date as reported by the operating system (OS) of your machine. In unix or DOS system, this is the information displayed by the [ date ] command. In the MVS mainframe, this is the information usually displayed on the top right part of the ISPF login panel. In Windows, this is the information shown in the clock of the taskbar.

Basically, the file creation/modification/access time is marked with this machine date by the OS.

In unix, normal users are not allowed to change this machine date. The [ date ] command can only display the machine date. But, super users can use the [ date ] command to CHANGE the machine date.

4. Job Order Date

This term applies for some job scheduler. This is the time when the job scheduler to [ create ] a job according to the information in the job database. One can refer it as the job born date. Once a job is ordered out, it comes to this world and is WAITING for execution.

Noted that this job order date may NOT be the same as the job execution date. Usually, a job is executed only when in-condition(s) is satisfied. If there is delay, the job execution date may be 1, 2, 3 or more days after the job order date. In other words, for example, job ordered on 1st of the month may NOT be run/executed on the 1st of the month.

5. Job Execution Date

This is the time when the job starts execution. This is the time when the job is kick-off. If the job creates a job log file once it is run, the file creation date will be the job execution date.

6. System Date

The term [ System Date ] is very ambiguous. It can refer to many things. Some refer system date as the machine date. Some refer this as the [ Today ] of the computer system/project.

When [ System Date ] means the [ Today ] of the computer system/project, usually it will be stored in a file. Then, all the program will read this file to get the [ Today ] value, rather than getting the machine date using API call to the OS. Using this method, all programs will get the SAME date information even when some programs are run after midnight. Also, this method is easy for project/program development and testing. Programmers can put any date you like into the file for development and testing. For example, when testing leap year behavior of your system/project, simply put a Feb 28th or Feb 29th into the file will do.

It is quite odd to use the machine date as the [ Today ] of a computer system/project. When doing so, one has to make sure that all the jobs/programs in the system/project must be finished before midnight. After midnight, it is tomorrow.

7. Reporting Date

Again, [ Reporting Date ] is ambiguous. Some may refer it as the [ Today ] of the computer system/project. Some will refer it as the as-of date of a report generated by the program. Therefore, when using this term, please make sure what is the exact meaning of [ Reporting Date ].

In some computer system/project design, the as-of date of a report is 1 day before the [ Today ] of the computer system/project. This is because that computer system/project is designed to work on data of yesterday. You can view the situation as running the computer system/project after midnight working on data of yesterday.

In some computer system/project design, the as-of date of a report will be the SAME as the [ Today ] of the computer system/project. For example, after 17:00 everyday, all the business data are ready and the jobs of [ Today ] will start working on that data. When the job is running slowly until after midnight to next morning, please ensure that the [ Today ] value will not be changed after midnight.

8. Report Printing Date

This term is clear and non-ambiguous. It simply refers to the time of printing the report.

When reading a report having the text [ Report Date : XXXX-XX-XX ], please make sure what this ambiguous text is talking about. Does it refer to the as-of date ? Or, the report printing date ?

9. File Creation / Modification / Access Date

These 3 types of date information of a file sound simple. For the modification / access date information, they refer to the time of last modified / access of the file. The creation date refer to the time when the file is created.

But, remember that NOT all filesystems will store the file creation date. Many unix inode filesystems does NOT store the file creation date information.

This is a widespread misconception about the [ -ctime ] option of the unix [ find ] command. Actually, the [ c ] does NOT stand for [ creation ]. The [ -ctime ] option shows the last time when the status of the inode is changed. When you change the permission of the file or rename the file, the [ -ctime ] information is updated. In other words, the [ c ] stands for the last [ changed ] time of the inode status of the file. Only when you do not rename, change permission, ... etc on the file since its creation, the ctime can be treated as the file creation date. But this case is really rare.

On the other hand, NTFS5 filesystem will store the file creation date time information. When you copy an old file with a new name, the newly created file will have a modification date OLDER than the file creation date.






After reading this article, next time when designing a computer system/project concerning the [ Date ], please make sure what [ Date ] is talking about. Also, pay additional attention when dealing with the file creation date information.


No comments:

Duplicate Open Current Folder in a New Window

Sometimes after I opened a folder in Win7, I would like to duplicate open the same folder again in another explorer window. Then, I can ope...