Skip to content

Temporal Expression Examples

zacg edited this page Sep 14, 2010 · 13 revisions

First day of every month between the year 2000 and 2010.
TemporalExpression te = new TEYear(2000,2010) & new TEDayOfMonth(1);

First day of every month between the year 2000 and 2010 except March.
TemporalExpression te = (new TEYear(2000,2010) & new TEDayInMonth(1)) - new TEMonth(Month.March);

Last Saturday of every month between July and November.
TemporalExpression te = new TEMonth(Month.July, Month.November) & new TEDayOfMonth(DayOfWeek.Saturday,-1);

Every weekday:
TemporalExpression te = new TEWeekDay(DayOfWeek.Monday,DayOfWeek.Friday);

Every Tuesday or Friday of every 2nd week:
TemporalExpression te = (new TEWeekDay(DayOfWeek.Tuesday) | TEWeekDay(DayOfWeek.Friday)) & TEInterval(new DateTime(2010, 6, 1), 2, IntervalPrecision.Weeks);

Last day of every month in 1st and 4th quarters
TemporalExpression te = new TEQuarter(Quarter.Fourth, Quarter.First);
te &= new TEDayinMonth(-1);

Noon of the second Friday of every month in every 3rd quarter when the financial year starts in February
TemporalExpression te = new TEDayOfMonth(DayOfWeek.Friday, 2);
te &= new TEHour(12);
te &= new TEQuarter(3,Month.February);

Clone this wiki locally