# sunrise in the Netherlands
sunrise("2016-01-01", 5, 53)
# sunset in the Netherlands
sunset("2016-01-01", 5, 53)
# civil twilight in Ithaca, NY
sunrise("2016-01-01", -76.5, 42.4, elev = -6)
# next sunset in South Dakota, USA
sunset("2016-11-15", -98, 45)
# Beware that some days have two sunsets, or
# two sunrises! E.g. on 5 Oct (local timezone) at
# this location sunset is actually on the 6 Oct
# in UTC time zone, i.e. the next day
sunset("2016-10-5", -98, 45)
# One day later, sunset is again on 6 Oct:
sunset("2016-10-6", -98, 45)
# working in local time zones typically avoids such ambiguities:
sunset(lubridate::as_datetime("2016-06-05",tz="America/Chicago"), -98, 45)
sunset(lubridate::as_datetime("2016-06-06",tz="America/Chicago"), -98, 45)
# use force_tz to force output to a specific time zone, by default UTC:
sunset(lubridate::as_datetime("2016-06-05",tz="America/Chicago"), -98, 45, force_tz=TRUE)
sunset(lubridate::as_datetime("2016-06-06",tz="America/Chicago"), -98, 45, force_tz=TRUE)
# Also beware of jumps in sunrise and sunset date with longitude:
sunrise("2016-11-01", 100, 45)
sunrise("2016-11-01", 102, 45)
# Sunrise in the Netherlands
sunrise("2016-01-01", 5, 53)
# Sunset in the Netherlands
sunset("2016-01-01", 5, 53)
# Civil twilight in Ithaca, NY
sunrise("2016-01-01", -76.5, 42.4, elev = -6)
# Next sunset in South Dakota, USA
sunset("2016-11-15", -98, 45)
# Beware that some days have two sunsets, or two sunrises! E.g. on 5 Oct
# (local timezone) at this location sunset is actually on the 6 Oct in UTC,
# i.e. the next day
sunset("2016-10-5", -98, 45)
# One day later, sunset is again on 6 Oct
sunset("2016-10-6", -98, 45)
# Working in local time zones typically avoids such ambiguities
sunset(lubridate::as_datetime("2016-06-05", tz = "America/Chicago"), -98, 45)
sunset(lubridate::as_datetime("2016-06-06", tz = "America/Chicago"), -98, 45)
# Use force_tz to force output to a specific time zone, by default UTC
sunset(lubridate::as_datetime("2016-06-05", tz = "America/Chicago"), -98, 45, force_tz = TRUE)
sunset(lubridate::as_datetime("2016-06-06", tz = "America/Chicago"), -98, 45, force_tz = TRUE)
# Also beware of jumps in sunrise and sunset date with longitude
sunrise("2016-11-01", 100, 45)
sunrise("2016-11-01", 102, 45)
Run the code above in your browser using DataLab