Dates
Dates are ubiquitous and seemingly simple, but along with security and entity mappings they are central to correctness in research.
To this end we have created a new date object to allow for both ease of use and functionality. We refer to this as the yyyymmdd class
and it is simply an integer representing the dates.
Constructor
- Python
- R
qk.insider(qk.ticker("AAPL"), 202601)
# today
d <- today()
# create a date object
d <- yyyymmdd(20260223)
# add or subtract days
today() - 3
d + days(10)
d + days(-5)
# add or subtract qtrs
d + qtrs(4)
d - qtrs(2)
to_yyyy(d) # 2026
to_qq(d) # 1
to_yyyyqq(d) # 202601