Dynamic Date-Time Values |
|
Dynamic data within the Logic Template is data, which unlike literals, must be determined at run time. Three types of dynamic data exist: dynamic values, dynamic text strings, and dynamic date-time values.
A dynamic date-time value may be an HTML variable, a field date-time value, a relative date value, a relative time value, a relative date-time value, a simple date-time expression, or a complex date-time expression.
An HTML variable is a name to which a value has been assigned, either as part of a name-value pair within the query URL, or as the result of an assignment statement within the logic template.
Dynamic Date-Time Values
A dynamic date-time value can be used within any numerical expression where
a date-time variable can be used. If a dynamic date-time value is to be
displayed, it must be done using a Format
command. Displaying it directly would result in it being displayed
as a meaningless unsign integer value.
Value |
Description |
"today" |
A relative date. |
"this hour" |
A relative time. |
"now" |
A relative date-time. |
Simple
Expressions
A simple date-time expression can be either a combination of one or more
time duration values connected by plus or minus signs; or a combination
of one or more time duration values plus a relative date value or a relative
time value or a relative date-time value, connected by plus or minus signs.
A simple date-time expression is enclosed within quotation marks. No individual
components of the expresion are independently enclosed within quotation
marks.
Evaluation of the expression proceeds from left to right. There is no precedence given to any operator over any other.
Expression |
Description |
"today - 3 days" |
3 days before the current date |
"1 hour + 30 mins" |
one hour and 30 minutes |
"last year + 34 days + 12 hours" |
12:00 noon last February 4th |
Complex
Expression
A complex date-time expression is any combination of simple date-time expressions
date, time, or date-time constants; date-time extractions; relative date,
time or date-time values; and time duration values, and reasonable numeric
functions; grouped by one or more pairs of parenthesis.
Evaluation of the expression proceeds from the inner-most level of parenthesis outward, and then from left to right within each level. There is no precedence given to any operator over any other.
Expression |
Description |
( NewDate |& OldDate ) - "3 days" ) |
Use NewDate if present, and OldDate if not, then subtract 3 days to obtain the start date. |
An HTML variable is a name to which a value has been assigned, either as part of a name-value pair within the query URL, or as the result of an assignment statement within the Logic Template.
A field date-time value is a value extracted from a date-time data field within the record currently being processed. It is expressed simply as the name of the date-time data field defined within the Load Definition file.
`PUB_DATE` publication date for an article
Relative Date Values
A relative date value is any one of a number of supported strings enclosed
within a pair of quotation marks. The result returned is relative to the
current system date.
Value |
Description |
“yesterday” |
The current date minus one day. |
"today" |
The current date. |
“tomorrow” |
The current date plus one day. |
“last day” |
The current date minus one day. |
“this day” |
The current date. |
“next day" |
The current date plus one day. |
“last week” |
Sunday of last week. |
“this week” |
Sunday of the current week. |
“next week” |
Sunday of next week. |
“last month” |
The first of last month. |
“this month” |
The first of this month. |
“next month” |
The first of next month. |
“last year” |
January first of last year. |
“this year” |
January first of this year. |
“next year" |
January first of next year. |
Relative Time Values
A relative time value is any one of a number of supported strings enclosed
within a pair of quotation marks. The result returned is relative to the
current system time.
Value |
Description |
“last minute” |
The current date and time to the minute minus one minute. |
"this minute" |
The current date and time to the minute. |
“next minute” |
The current date and time to the minute plus one minute. |
“last hour” |
The current date and time to the hour minus one hour. |
“this hour” |
The current date and time to the hour. |
“next hour" |
The current date and time to the hour plus one hour. |
Relative Date-Time Value
A relative date-time value is any one of a number of supported strings
enclosed within a pair of quotation marks. The result returned is relative
to the current system date and time.
Value |
Description |
“now” |
The current date and time. |