Creates a DateTime value by assembling individual numeric components - year, month, day, hour, minute, and second - into a single DateTime object that can be used by other actions in your ruleset.
| Property | Type | Description | Valid Range | Example |
|---|---|---|---|---|
| Year | Number | The four-digit calendar year | e.g. 2024
|
2024 |
| MonthOfYear | Number | The month of the year |
1 (January) – 12 (December) |
6 |
| DayOfMonth | Number | The day of the month |
1 – 31 (varies by month) |
15 |
| HourOfDay | Number | The hour of the day in 24-hour format |
0 (midnight) – 23 (11 PM) |
13 |
| MinuteOfHour | Number | The minute within the hour |
0 – 59
|
45 |
| Seconds | Number | The second within the minute |
0 – 59
|
30 |
Result for the example values above: 2024-06-15T13:45:30
Notes
- Any property that is null is ignored, meaning omitted fields default to their baseline values (e.g. omitting HourOfDay, MinuteOfHour, and Seconds effectively sets the time to midnight).
- An IllegalArgumentException is thrown if any field is out of range — for example, setting MonthOfYear to
13or DayOfMonth to32will cause the action to fail. Be sure to validate source values before passing them in, particularly when they originate from external documents where data quality isn't guaranteed.
Typical Use Case
Constructing a ship date from discrete EDI fields
Inbound EDI documents sometimes carry date components in separate fields — for example, an 850 Purchase Order might provide year, month, and day as individual string values. After converting each to a Number, you can feed them into CreateDateTime to assemble a proper DateTime, which can then be passed to actions like AddDateTime, CalculateDuration, or CreateStringFromDateTime for output formatting.
Example — Build a required ship date of June 15, 2024 at 1:45 PM:
| Property | Value |
|---|---|
| Year | 2024 |
| MonthOfYear | 6 |
| DayOfMonth | 15 |
| HourOfDay | 13 |
| MinuteOfHour | 45 |
| Seconds | 0 |
Result: 2024-06-15T13:45:00 — a fully formed DateTime ready for downstream processing.
Related Actions
-
CreateDateTimeFromString: use this instead if your source date arrives as a formatted string (e.g.
"2024-06-15") rather than discrete numeric fields. - CreateDateTimeFromMilliseconds: use when your source system provides a Unix epoch timestamp.
- AddDateTimeWithFields: use after CreateDateTime to shift the resulting timestamp forward or backward by a specified interval.
Comments
0 comments
Please sign in to leave a comment.