[R-SIG-Finance] extract certain date in a month

Diethelm Wuertz wuertz at itp.phys.ethz.ch
Tue Jan 15 19:06:14 CET 2008


ShyhWeir Tzang wrote:
> Dear all:
>
> How can I extract the date of the third Wednesday in each month? Is there
> any available function to do it?
> Thanks for help.
>
> ShyhWeir
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. 
> -- If you want to post, subscribe first.
>
>   
The Rmetrics package has special dates functions

# FUNCTION:                 FIRST AND LAST DAY IN PERIOD:
#  timeLastDayInMonth        Computes the last day in a given month and year
#  timeFirstDayInMonth       Computes the first day in a given month and 
year
#  timeLastDayInQuarter      Computes the last day in a given quarter 
and year
#  timeFirstDayInQuarter     Computes the first day in a given quarter 
and year
# FUNCTION:                 DAYS BEFORE AND AFTER:
#  timeNdayOnOrAfter         Computes date in month that is a n-day ON 
OR AFTER 
#  timeNdayOnOrBefore        Computes date in month that is a n-day ON 
OR BEFORE 
# FUNCTION:                 THE N'TH DAY IN:
#  timeNthNdayInMonth        Computes n-th ocurrance of a n-day in 
year/month
#  timeLastNdayInMonth       Computes the last n-day in year/month


timeLastNdayInMonth, calculates e.g. the last Friday in April, ....
timeNthNdayInMonth, calculates e.g. second Monday in June


reagrds
Diethelm Wuertz



More information about the R-SIG-Finance mailing list