Skip to content

DateTime

The DateTimeTask node generates the current date and time, with optional adjustments and formatting. It is typically used to compute dynamic timestamps for logging, scheduling, or data formatting within your automation workflow.


Dependencies

No external service or node dependencies are required for this node.


Operations

OperationDescription
AddYearsAdds the specified number of years.
AddMonthsAdds the specified number of months.
AddDaysAdds the specified number of days.
AddHoursAdds the specified number of hours.
AddMinutesAdds the specified number of minutes.
AddSecondsAdds the specified number of seconds.
AddMillisecondsAdds the specified number of milliseconds.

Input Fields

LabelInput TypeDescriptionRequiredVisible WhenDefaultExample
Adjust Now DatepicklistThe unit to adjust the current date/time by.❌ NoAlwaysnullAddDays
Number to Adjust bytextThe number of units to adjust the current date by.❌ NoAlways02
String Formatted DatetextA .NET format string to convert the date to a formatted string.❌ NoAlwaysdd/MM/yyyy hh:mm:ss ttyyyy-MM-dd

Output

The result of the selected operation is stored in the specified Output Variable Name.
This will contain either a DateTimeObject or a StringFormattedDate depending on configuration.

KeyTypeDescription
DateTimeObjectDateTimeThe calculated DateTime, with adjustment applied if specified.
StringFormattedDatestringThe formatted date string, if a format string is provided.

Examples

AddYears – Add years to the current date.
FieldValue
Adjust Now DateAddYears
Number to Adjust by1
String Formatted Dateyyyy-MM-dd
OutputDateTimeObject: 2026-08-20T16:00:00.0000000+10:00
StringFormattedDate: "2026-08-20"
AddMonths – Add months to the current date.
FieldValue
Adjust Now DateAddMonths
Number to Adjust by3
String Formatted Dateyyyy-MM
OutputDateTimeObject: 2025-11-20T16:00:00.0000000+10:00
StringFormattedDate: "2025-11"
AddDays – Add days to the current date.
FieldValue
Adjust Now DateAddDays
Number to Adjust by2
String Formatted Dateyyyy-MM-dd
OutputDateTimeObject: 2025-08-22T16:00:00.0000000+10:00
StringFormattedDate: "2025-08-22"
AddHours – Add hours to the current time.
FieldValue
Adjust Now DateAddHours
Number to Adjust by5
String Formatted Dateyyyy-MM-dd HH:mm
OutputDateTimeObject: 2025-08-20T16:00:00.0000000+10:00
StringFormattedDate: "2025-08-20 16:00"
AddMinutes – Add minutes to the current time.
FieldValue
Adjust Now DateAddMinutes
Number to Adjust by30
String Formatted DateHH:mm
OutputDateTimeObject: 2025-08-20T11:30:00.0000000+10:00
StringFormattedDate: "11:30"
AddSeconds – Add seconds to the current time.
FieldValue
Adjust Now DateAddSeconds
Number to Adjust by45
String Formatted DateHH:mm:ss
OutputDateTimeObject: 2025-08-20T11:00:45
StringFormattedDate: "11:00:45"
AddMilliseconds – Add milliseconds to the current time.
FieldValue
Adjust Now DateAddMilliseconds
Number to Adjust by500
String Formatted DateHH:mm:ss.fff
OutputDateTimeObject: 2025-08-20T11:00:00.5000000+10:00
StringFormattedDate: "11:00:00.500"
No Adjustment – Use current system time without modification.
FieldValue
Adjust Now Datenull
String Formatted Dateyyyy-MM-dd
OutputDateTimeObject: 2025-08-20T11:00:00.0000000+10:00
StringFormattedDate: "2025-08-20"

Potential Errors

Error ConditionDescription
TBD

Developer Notes

  • If no adjustment is provided, the task uses the current system time (DateTime.Now).
  • Supports standard .NET format strings for date formatting (see .NET custom date format strings).

Tentech 2024