This function converts raw data into a date time object conform the Amiga file system specifications.
Usage
rawToAmigaDate(x, format = c("long", "short"), tz = "UTC")
Arguments
- x
a
vector
ofraw
values with a length of a multitude of 6 (for the short format) or 12 (for the long format).- format
a
character
string indicating whether the date is stored asshort
orlong
integers.- tz
A
character
string specifying the time zone to be used to retrieve the date time object. Note that the time zone is not stored on the Amiga. By default the Universal time zone (UTC) is assumed.
Value
Returns a POSIXct
object based on the provided
raw data.
Details
The Amiga file system stores date time objects as three unsigned short (16 bit) or long (32 bit) integers. Where the values are number of days, minutes and ticks (fiftieth of a second) since 1978-01-01 respectively.
As these values are always positive, only date time values on or after
1978-01-01 are allowed. The inverse of this function can be achieved
with amigaDateToRaw
.
See also
Other raw.operations:
amigaDateToRaw()
,
amigaIntToRaw()
,
displayRawData()
,
rawToAmigaInt()
,
rawToBitmap()
Examples
## all raw data is zero, so the origin date is returned:
rawToAmigaDate(raw(12))
#> [1] "1978-01-01 UTC"
## let's get the date, one day, one minute and 50 ticks from the origin:
rawToAmigaDate(amigaIntToRaw(c(1, 1, 50), 32))
#> [1] "1978-01-02 00:01:01 UTC"