time_convert: Convert Julian Day to Date and vice versa

View source: R/time_convert.R

time_convertR Documentation

Convert Julian Day to Date and vice versa

Description

The function converts a Julian Day value to a date, to POSIXct if a year is provided, otherwise to POSIXlt.

Usage

time_convert(input, output, timezone = "UTC", year)

Arguments

input

Numeric vector, input time Supported formats are YYYY-MM-DD, JD and POSIXct.

output

Numeric vector, output time. Supported formats are YYYY-MM-DD, JD and POSIXct.

timezone

Character vector, time zone of the output date. Default is "UTC".

year

Character vector, year of the date. Only used when input is JD. If omitted, the current year is used.

Value

Numeric vector,

Author(s)

Michael Dietze

Examples


## convert Julian Day 18 to POSIXct
time_convert(input = 18, output = "POSIXct")

## convert Julian Day 18 to yyyy-mm-dd
time_convert(input = 18, output = "yyyy-mm-dd")

## convert yyyy-mm-dd to Julian Day
time_convert(input = "2016-01-18", output = "JD")

## convert a vector of Julian Days to yyyy-mm-dd
time_convert(input = 18:21, output = "yyyy-mm-dd")
                     

eseis documentation built on Aug. 10, 2023, 5:08 p.m.

Related to time_convert in eseis...