🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.tech
Article #283

Re: Archimedes <-> Unix timestamp conversion

#283
From: I.D. Griffiths
Date: Fri, 09 Oct 1992 15:17
24 lines
1451 bytes
In article <1992Oct9.004808.4421@cs.aukuni.ac.nz>, pgut1@cs.aukuni.ac.nz
(Peter Gutmann) writes:
|> Does anyone know how to convert from the 5-byte file timestamp to the
|> standard seconds-since-1970 4-byte Unix one?

Yup, had to do that one this summer...

Find out how to offset things from 1970 in Acorn format.  Easily done thus:

temp$=TIME$
TIME$="...acorny type date for 1st jan 1970"
OS_Word thingy to read time
TIME$=temp$

This will give you a value to subtract from Acorn dates to get them relative to
1970.

Then, divide by 100.  OK, so this is not a fun thing to have to do particularly
in assembler, but it is the only way to do it properly.   Getting the time
roughly in seconds isn't particularly helpful.  It's relatively easy going in
the other direction.  (I had to write both routines this summer, but I suspect
the direction you wish to go in ended up being in the C bit...)

Ian Griffiths
Technical Details
Message-ID: <1992Oct9.151738.20184@infodev.cam.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!pavo.csi.cam.ac.uk!cam-cl!idg10
References: <1992Oct9.004808.4421@cs.aukuni.ac.nz>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.acorn.tech
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!pavo.csi.cam.ac.uk!cam-cl!idg10
From: idg10@cl.cam.ac.uk (I.D. Griffiths)
Subject: Re: Archimedes <-> Unix timestamp conversion
Message-ID: <1992Oct9.151738.20184@infodev.cam.ac.uk>
Sender: news@infodev.cam.ac.uk (USENET news)
Nntp-Posting-Host: hall.cl.cam.ac.uk
Reply-To: idg10@cl.cam.ac.uk (I.D. Griffiths)
Organization: U of Cambridge, England
References: <1992Oct9.004808.4421@cs.aukuni.ac.nz>
Date: Fri, 9 Oct 1992 15:17:38 GMT
Lines: 24