AppleShare: Modification Date Depends On Client‘s Clock

We have an AppleShare File Server. One morning, a user put a file at the root level. On his machine, the file correctly showed a modification date of 21 February.

When the server volume was mounted on another Macintosh, the modification date showed up as 18 February. We noticed that this Macintosh's clock was set to 18 February. When we reset the clock to the correct date, the modification date changed back to 21 February.

What's going on here? The date on any single machine should not affect the date that shows up for the file. Shouldn't the server be giving the creation date? Why would the Finder show the wrong date?
This is not a bug and is intentional. Here is some text from "Inside AppleTalk, Second Edition," pages 13-21 and 13-22, that discusses this subject:

Date-time Values
----------------
"All date-time quantities used by AFP specify values of the server's clock. These values correspond to the number of seconds measured from 12:00 AM on January 1, 2000. In other words, the start of the next century corresponds to the date-time of 0. AFP represents date-time values with 4-byte signed integers."

"One of the AFP calls, allows the workstation to obtain the current value of the server's clock. At log on time, the workstation should read this value (s) and the value of the workstation's clock (w) and compute the offset between these values: s-w. All subsequent date-time values read from the server should be adjusted by subtracting this offset from the date-time. All subsequent date- time values sent to the server should be adjusted by adding this offset to the date-time. This adjustment will correct for differences between the two clocks and will ensure that all workstations see a consistent time base."

One thing to note here is with Apple's AFP servers, the time base is not adjusted if the workstation's clock and server's clock are within 15 minutes or so of each other. This is done so slight differences between the workstation's clock and the server's clock settings do not affect the file date-time values. If the time difference is more than 15 minutes, the time is adjusted to the nearest half hour. For example, if the server clock is 20 minutes ahead of the workstation clock, the date-time value for a file would be 30 minutes less on the workstation. Non-Apple AFP servers may do this differently.

Some Examples
-------------
Note: These examples assume the time zone values are set correctly on the server and the client unless otherwise specified.

* Example 1:
There is an AppleShare File Server in New York and its clock says it is 4:01 PM. There is an AppleShare client in Los Angles that is logged into the server in New York and its clock says it is 1:00 PM. A "Get Info" is done on file "X" by someone in New York on the New York server and the created and modified date-time says:

"Wed, Mar 4,1992, 7:07 PM"

At the workstation in Los Angeles, a "Get Info" is done on file "X" on the New York server, and the created and modified date-time says:

"Wed, Mar 4,1992, 4:07 PM".

As you can see, the client in Los Angeles shows the file created and modified date-time stamp as being 3 hours earlier.

* Example 2:
There is a AppleShare File Server in San Jose and its clock says it is 8:21 PM. There is a AppleShare client, also in San Jose, that is logged into this server and its clock says it is 8:00 PM. A "Get Info" is done on file "X" at the server and the created and modified date-time says:

"Wed, Mar 4,1992, 7:07 PM".

The client does a "Get Info" on file "X" and the created and modified date-time says:

"Wed, Mar 4,1992, 6:37 PM".

If the client's clock had been within 15 minutes of the server's clock, the file would have had the same date-time stamp.

All of our testing regarding this date-time stamping issue shows that the actual time shown in the "General Controls" or "Date & Time" Control Panel is what is used to compute the date-time offset between the client and the server.
Published Date: Feb 20, 2012