Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

amigaDateToRaw

Convert date time objects into raw values


Description

This function converts date-time objects into raw data conform Amiga file system specifications.

Usage

amigaDateToRaw(x, format = c("long", "short"), tz = "UTC")

Arguments

x

A (vector of) POSIXt object(s).

format

a character string indicating whether the date should be stored as short or long integers.

tz

A character string specifying the time zone to be used to convert the date time object. Note that the time zone is not stored on the Amiga. By default the Universal time zone (UTC) is assumed. You will get a warning when you use a timezone other then UTC.

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 rawToAmigaDate.

Value

returns raw data reflecting the date-time objects conform the Amiga file system specifications.

Author(s)

Pepijn de Vries

See Also

Examples

## Note that using the same date-time with different timezones will
## result in different raw data. The time zone is not stored.
amigaDateToRaw(as.POSIXct("1978-01-01 13:30", tz = "UTC"))
amigaDateToRaw(as.POSIXct("1978-01-01 13:30", tz = "CET"))

adfExplorer

Import from and Export to Amiga Disk Files

v0.1.4
GPL-3
Authors
Pepijn de Vries [aut, cre, dtc]
Initial release
2018-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.