datetime_as_season: Calculate the "turtle season" (FY) from a given datetime

View source: R/datetime_as_season.R

datetime_as_seasonR Documentation

Calculate the "turtle season" (FY) from a given datetime

Description

\lifecycle

stable

Usage

datetime_as_season(datetime)

Arguments

datetime

(dttm) A datetime

Details

Return the start year of the fiscal year of a given date.

The "turtle season" is calculated as the calendar year 180 days prior to the given date.

Note the fiscal year is often labelled as the end year of the FY, so that FY 2020 referes to FY 2019-20. We use the start year (e.g. 2019 for a date in July-Dec 2019), as most turtle monitoring is done in the first half of the FY, where the "turtle season" year is equal to the calendar year.

Value

The season as int, e.g. 2017

See Also

Other helpers: absolute_angle(), add_dates(), datetime_as_isoweek(), datetime_as_seasonweek(), datetime_as_turtle_date(), exclude_training_species(), exclude_training_surveys(), extract_possibly(), fdate_as_tdate(), filter_missing_site(), filter_missing_survey(), filter_surveys_missing_end(), filter_surveys_requiring_qa(), filter_wastd_season(), get_more(), gj_linestring_to_st_linestring(), httpdate_as_gmt08_turtle_date(), httpdate_as_gmt08(), httpdate_as_season(), humanize(), join_tsc_sites(), leaflet_basemap(), map_chr_hack(), mean_bearing(), mis_bearing(), odkc_works(), read_table(), sentencecase(), sf_as_tbl(), tdate_as_fdate(), tracks_as_geojson(), tun(), urlize(), verify_odkc_turtledata(), verify_wamtram_data(), verify_wastd_data(), wastd_works(), wastdr_msg_abort(), wastdr_msg_info(), wastdr_msg_noop(), wastdr_msg_success(), wastdr_msg_warn(), wastdr_settings(), wastdr_setup()

Examples

# These datetimes are turtle season 2017:
datetime_as_season(httpdate_as_gmt08("2017-06-30T15:59:59Z")) # 2016
datetime_as_season(httpdate_as_gmt08("2017-06-30T16:00:00Z")) # 2017
datetime_as_season(httpdate_as_gmt08("2017-08-30T06:38:43Z")) # 2017

parksandwildlife/wastdr documentation built on Nov. 17, 2022, 4:52 p.m.