Return position within a ti
period, or a particular
day within the period.
dayOfPeriod(xTi = today(), tif = NULL)
dayOfWeek(xTi = today())
dayOfMonth(xTi = today())
dayOfYear(xTi = today())
firstDayOf(xTi)
lastDayOf(xTi)
firstBusinessDayOf(xTi)
lastBusinessDayOf(xTi)
firstBusinessDayOfMonth(xTi)
lastBusinessDayOfMonth(xTi)
currentMonthDay(xTi, daynum)
latestMonthDay(xTi, daynum)
a ti
object or something that the ti()
function can turn into a ti
object
a time index frequency code or name. See tif
.
day number in month
All of the functions except the dayOfXXXXX
return ti
objects as described in the details section above. The
dayOfXXXXX
functions return numbers.
The dayOfXXXXX
functions all work the same way, returning the
day number of the XXXXX that jul(xTi)
falls on. For example,
if today is Thursday, January 5, 2006, then dayOfWeek()
,
dayOfMonth()
and dayOfYear()
are all 5. All of these
are implemented via dayOfPeriod
, which converts its first
argument to a Julian date (via jul(xTi)
) and finds the
ti
with frequency tif
that day falls into. It returns
the day number of the period represented by that time index that the
Julian date falls on.
firstDayOf
and lastDayOf
return a daily ti
for
the first or last day of the period represented by xTi
.
firstBusinessDayOf
and lastBusinessDayOf
do the same but
the returned ti
has business daily frequency.
firstBusinessDayOfMonth
returns a business daily ti
for
the first business day of the month of xTi
.
lastBusinessDayOfMonth
does the same but for the last business
day of the month of xTi
.
currentMonthDay
returns a daily ti
for the next upcoming
daynum
'th of the month. latestMonthDay
does the same
for the most recent daynum
'th of the month.
currentMonday
returns the daily ti
for the last day of
the Monday-ending week that its argument falls into. The other
current{Weekday}
functions work the same way.
ti
, tif
, jul
,
holidays
, nextBusinessDay
,
previousBusinessDay