1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

datetime → Add Value to a Date

AI-generated

Overview

The "Add Value to a Date" operation in the datetime resource of this n8n node allows you to add (or subtract) a specified amount of time to a given date. This is useful for automating workflows that require date calculations, such as scheduling reminders, calculating deadlines, or adjusting timestamps.

Practical examples:

  • Adding 7 days to a due date to set a follow-up reminder.
  • Subtracting 2 months from a contract end date to trigger a renewal process.
  • Adding hours or minutes to a timestamp for time zone adjustments.

Properties

Name Meaning
Date The date to which you want to add or subtract time. Supported formats include:
- DD.MM.YYYY
- DD.MM.YY
- DD.MM.YYYY HH:mm
- DD.MM.YY HH:mm
- MM-DD-YYYY
- MM-DD-YYYY HH:mm
- MM-DD-YY
- MM-DD-YY HH:mm
Key What unit of time to add. Options:
- days
- hours
- milliseconds
- minutes
- months
- quarters
- seconds
- weeks
- years
Amount The quantity of the selected unit to add. Use negative numbers to subtract. For example, -3 will subtract three units (e.g., days, months, etc.).

Output

  • The output will be a JSON object containing the result of the date calculation. The exact structure depends on the API response, but typically it will include the new calculated date.
  • No binary data is produced by this operation.

Example output:

{
  "result": "2024-07-10T00:00:00Z"
}

(Note: The actual key name may vary depending on the API's response.)

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • Environment: Ensure your n8n instance can reach the 1001fx API endpoint.

Troubleshooting

Common issues:

  • Invalid date format: If the input date does not match one of the supported formats, the API may return an error. Double-check your date string.
  • Missing required fields: All properties (Date, Key, Amount) are required. Omitting any will cause the node to fail.
  • API authentication errors: If your API key is missing or invalid, you'll receive an authentication error. Make sure your credentials are correctly configured.

Error messages and resolutions:

  • "Invalid date format": Ensure your date matches one of the accepted formats.
  • "Missing required parameter": Check that all required fields are filled in.
  • "Authentication failed": Verify your 1001fx API credentials in n8n.

Links and References

Discussion