rawToAmigaDate: Convert raw values into a date time object

View source: R/01genericSupport.r

rawToAmigaDateR Documentation

Convert raw values into a date time object

Description

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 of raw 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 as short or long 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.

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.

Value

Returns a POSIXct object based on the provided raw data.

Author(s)

Pepijn de Vries

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))

## let's get the date, one day, one minute and 50 ticks from the origin:
rawToAmigaDate(amigaIntToRaw(c(1, 1, 50), 32))

adfExplorer documentation built on May 29, 2024, 11:23 a.m.