Skip to content

Instantly share code, notes, and snippets.

@dalejung
Created August 16, 2012 22:37
Show Gist options
  • Save dalejung/3374268 to your computer and use it in GitHub Desktop.
Save dalejung/3374268 to your computer and use it in GitHub Desktop.
End point for weeks
utc_time <- as.POSIXlt(c("2012-08-12 23:55:00","2012-08-13 00:05:00"), tz="UTC")
utc_weeks <- endpoints(utc_time, "weeks")
# [1] 0 1 2
est_time <- as.POSIXlt(c("2012-08-12 23:55:00","2012-08-13 00:05:00"), tz="US/Eastern")
est_weeks <- endpoints(est_time, "weeks")
# [1] 0 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment