Relative DateTime |
Relative DateTimes are formed using a set of rules that allow the DateTime to become a moving target based on the current DateTime.
A relative date/time is a dynamic expression that must start with a "Relative Start Term" followed by optional "Relative Duration Terms" that are added or subtracted from the start term value.
string startOfDaySevenDaysAgo = "Today - 7 Days";
Relative Start Term | Description |
---|---|
Now | Current time including sub-second data. |
Second | Start of the current second. |
Minute | Start of the current minute. |
Hour | Start of the current hour. |
Day/Today | Start of the current day. Use either term "Day" or "Today" |
Yesterday | Start of the previous day. |
Day of Week | Start of the day in the current week. Example "Friday" would be the start of Friday in the current week. |
Week | Start of the week. |
Month | Start of the month. |
Year | Start of the year. |
Relative Duration Term | Description |
---|---|
# Milliseconds | Number of milliseconds to add or subtract. |
# Seconds | Number of seconds to add or subtract. |
# Minutes | Number of minutes to add or subtract. |
# Hours | Number of hours to add or subtract. |
# Days | Number of days to add or subtract. |
# Weeks | Number of weeks to add or subtract. |
# Months | Number of months to add or subtract. |
# Years | Number of years to add or subtract. |