Skip to content

Instantly share code, notes, and snippets.

@Btibert3
Created January 23, 2020 19:19
Show Gist options
  • Select an option

  • Save Btibert3/87ae6648a5890e77cba262719b5ca3d1 to your computer and use it in GitHub Desktop.

Select an option

Save Btibert3/87ae6648a5890e77cba262719b5ca3d1 to your computer and use it in GitHub Desktop.
# timestamp tz conversion
DATE = "2020-01-23 13:23:45"
lubridate::ymd_hms(DATE)
ts = lubridate::ymd_hms(DATE, tz = "America/Los_Angeles")
ts
lubridate::with_tz(ts, tzone = "America/New_York")
ts_eastern = lubridate::with_tz(ts, tzone = "America/New_York")
lubridate::with_tz(ts, tzone = "UTC")
utc = lubridate::with_tz(ts, tzone = "UTC")
as.character(utc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment