[Stable]

datetime_as_isoweek(datetime)

Arguments

datetime

(dttm) A datetime

Value

The ISO week as int, e.g. 26

Details

Return the isoweek of a given datetime.

The isoweek is useful as a grouping variable for weekly summaries.

Examples

# These datetimes are turtle season 2017:
datetime_as_isoweek(httpdate_as_gmt08("2017-06-30T15:59:59Z")) # 26
#> [1] 26
datetime_as_isoweek(httpdate_as_gmt08("2017-06-30T16:00:00Z")) # 26
#> [1] 26
datetime_as_isoweek(httpdate_as_gmt08("2017-08-30T06:38:43Z")) # 35
#> [1] 35
datetime_as_isoweek(httpdate_as_gmt08("2017-11-01T22:00:00Z")) # 44
#> [1] 44
datetime_as_isoweek(httpdate_as_gmt08("2018-11-01T22:00:00Z")) # 44
#> [1] 44