
The statement performs a wide variety of date related functions.
All text fields may contain any of the escape sequences described in Escape Sequences.
The result of the statement will be stored into a specified track or named variable. If either the source or destination is a named variable, the statement will only be performed once if executing stepwise.
Note that date strings in Yate are oblivious to timezones. All dates are assumed to be in the system's timezone. The millisecond conversions do the necessary manipulations between URC and the system time zone.
Yate date formats are based on the Gregorian calendar. If your system is configured to use a Gregorian calendar, this calendar and its current settings will be used in all calculations. If your system calendar is not a Gregorian calendar, one will be provided.
The first step is to provide the primary function:
Certain date operations require knowledge of the day representing the first day of the week. By default the value used is the current System value. However, if your system calendar is not a Gregorian calendar, or if you wish to override your system value, you can force the first day to be Sunday (typically the default) or Monday.
A source date may be in a track or named variable. Yate parses a variety of date formats. The most standard format is the one described in timestamps. Yate will accept dash (-), slash (/) or period (.) as a separator for date components. Date components may be separated from time components by a T (case insensitive) or a space. Time specifications may be in 24 hour format or can be followed by AM or PM (case insensitive). You can choose to parse a date as Year-Month-Day, Day-Month-Year or Month-Day-Year. No attempt is made to automatically determine the component order. The supplied order is always used.
Years can be specified as two digits or four. A year of 0 through 99 is interpreted dependent on named variable Date Function Two Digit 1900 Start. The process is as follows:
In order to enable accurate parsing when a date is followed by an integer, a trailing time component of hours (no minutes) will only be processed if one or more of the following holds:
If the day, or month and day components are omitted a value of 1 is assumed for each missing component. 0 is assumed for any missing time components.
At runtime, if the effective source field is empty, either the current date or 0 will be assumed (depending on which operation is being performed).
The result of the statement will be stored into a specified track or named variable. If either the source or destination is a named variable, the statement will only be performed once if executing stepwise.
When a date is the result of the specified function, you have access to various settings which control the format. The five formatting options are displayed under the result destination field. The options from left to right are:
The effective display of the chosen result format is displayed in the representation in the list of statements at the top right of the window.
Unless otherwise specified all of the Extract Value functions return an integer value as the result. You can request the following items:
When offsetting to a date component, unless otherwise mentioned, you are adding a signed integer value to the component. A date specification is returned. Offsetting the Day, Week, Month, Year, Hours, Minutes or Seconds component is as you would expect. There are two Offset Date Modes which are slightly different:
This mode is used to apply a specific date format to the source date. It can be used to reformat a date or to remove the date or time components.
If the statement fails for any reason, the action test state will be set to false and the destination will be emptied. When running stepwise and multiple functions are performed, a test state of false implies that at least one failed. Upon success the action test state is set to true.
This statement can be used in conjunction with Scanner statements. However, you can only do so when a named variable or a single file is being processed. ie. not when execution is grouped and more than one file is available. If the action test state returned is true, the Date Function Scan Offset named variable will contain the offset of the first character not processed. This offset can be used with a Substring statement to extract the remainder of a string to be processed.