as_posix_ct function

Date-Time Conversion

Date-Time Conversion

Convert calendar date and times.

as_posix_ct(dt, tm, tm_unset = "12:00", tz = "")

Arguments

  • dt: 'character' vector. Calendar date formatted as YYYY-MM-DD.
  • tm: 'character' vector. Time in Greenwich Mean Time (UTC) formatted as HH:MM. Vector length equal to the length of dt.
  • tm_unset: 'character' string. Value if time is missing, noon by default.
  • tz: 'character' string. Time zone specification to convert to.

Returns

Returns an object of class 'POSIXct'.

Examples

as_posix_ct( dt = c("2024-01-01", "2024-02-15", NA), tm = c("14:30", NA, "11:11"), tz = "America/Denver" )

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center