date_decimal: Converts a decimal to a date.

Description Usage Arguments Value Examples

Description

Converts a decimal to a date.

Usage

1
date_decimal(decimal, tz = "UTC")

Arguments

decimal

a numeric object

tz

the time zone required

Value

a POSIXct object, whose year corresponds to the integer part of decimal. The months, days, hours, minutes and seconds elements are picked so the date-time will accurately represent the fraction of the year expressed by decimal.

Examples

1
2
3
date <- ymd("2009-02-10")
decimal <- decimal_date(date)  # 2009.11
date_decimal(decimal) # "2009-02-10 UTC"


Search within the lubridate package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.