Article View: comp.sys.acorn.tech
Article #271Archimedes <-> Unix timestamp conversion
From: Peter Gutmann
Date: Fri, 09 Oct 1992 00:48
Date: Fri, 09 Oct 1992 00:48
20 lines
1209 bytes
1209 bytes
Does anyone know how to convert from the 5-byte file timestamp to the
standard seconds-since-1970 4-byte Unix one? I've tried the following:
Take the exec.address (equivalent to time/256)
Shift left once (equivalent to time/128, roughly the time in seconds)
If the high bit of the remaining time byte is set, add one
(compensate for individual seconds)
Subtract the difference between the Archimedes and Unix epochs.
This is a quick and dirty way of dividing the 5-byte centisecond value to a
4-byte second one, and then adjusting for the difference in the epoch. The
only problem is this gives garbled time values.
Does anyone have any code to do this conversion?
Thanks in advance,
Peter.
--
pgut1@cs.aukuni.ac.nz || peterg@kcbbs.gen.nz || peter@nacjack.gen.nz
(In order of preference)
Technical Details
Message-ID:
<1992Oct9.004808.4421@cs.aukuni.ac.nz>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!pgut1Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!pgut1 Newsgroups: comp.sys.acorn.tech Subject: Archimedes <-> Unix timestamp conversion Message-ID: <1992Oct9.004808.4421@cs.aukuni.ac.nz> From: pgut1@cs.aukuni.ac.nz (Peter Gutmann) Date: Fri, 9 Oct 1992 00:48:08 GMT Organization: Computer Science Dept. University of Auckland Lines: 20