[Stable]

datetime_as_seasonweek(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_seasonweek(httpdate_as_gmt08("2017-07-02T15:59:59Z")) # 0
#> [1] 0
datetime_as_seasonweek(httpdate_as_gmt08("2017-07-02T16:00:00Z")) # 1
#> [1] 1
datetime_as_seasonweek(httpdate_as_gmt08("2017-08-30T06:38:43Z")) # 9
#> [1] 9
datetime_as_seasonweek(httpdate_as_gmt08("2017-11-01T22:00:00Z")) # 18
#> [1] 18
datetime_as_seasonweek(httpdate_as_gmt08("2018-11-01T22:00:00Z")) # 18
#> [1] 18