Skip to contents

Converts a datetime from local solar time back to UTC. Input time may be either apparent solar time or mean solar time.

Usage

convert_solartime_to_UTC(
  any.solar.time,
  longitude,
  time.type = c("apparent solar", "mean solar")
)

Arguments

any.solar.time

POSIXct vector in solar time. The timezone attribute must be UTC, even though the clock time represents solar time.

longitude

Numeric longitude in decimal degrees. Western longitudes are negative.

time.type

Character string: either "mean solar" or "apparent solar".

Value

A POSIXct datetime in UTC.

References

Yard, Bennett, Mietz, Coggins, Stevens, Hueftle, and Blinn. 2005. Influence of topographic complexity on solar insolation estimates for the Colorado River, Grand Canyon, AZ. Ecological Modelling.

Examples

utc <- as.POSIXct("2024-06-21 18:00:00", tz = "UTC")
solar <- convert_UTC_to_solartime(
  utc,
  longitude = -96.6,
  time.type = "mean solar"
)

convert_solartime_to_UTC(
  solar,
  longitude = -96.6,
  time.type = "mean solar"
)
#> [1] "2024-06-21 18:00:00 UTC"