# R program to find the quarter # of a specific date# Specifying the date
date <- as.POSIXlt("2020-06-23")
date
# Calling quarters() function
quarters(date)
R
输出
[1]"2020-06-23 UTC"[1]"Q2"
R
例2 :
# R program to find the quarter # of a specific date# Specifying the date
date <- as.POSIXlt("1994-01-17")
date
# Calling quarters() function
quarters(date)