Actions74
- ai Actions
- array Actions
- audiovideo Actions
- carbone Actions
- charts Actions
- code Actions
- data Actions
- datetime Actions
- events Actions
- files Actions
- geo Actions
- hellospaces Actions
- images Actions
- Get Metadata of an Image
- Scale an Image
- Overlay an Image on another Image
- Scale an Image to Fit Given Dimensions
- Resize an Image
- Mask an Image with Another Image
- Mask an Image with a Circle Mask
- Crops an image by the given x, y, width and height paramters.
- Convert Texts to an Image
- Convert HTML String or URL to an Image
- Generates a QRCode with given text and color.
- Get EXIF from Image
- Remove EXIF from Image
- Modify Image EXIF
- playground Actions
- spreadsheet Actions
- stripe Actions
- youtube Actions
datetime → Format Date and Time
AI-generatedOverview
The Format Date and Time operation in the "datetime" resource of this n8n node allows you to reformat a given date string into a desired output format. This is useful when working with dates from various sources that may use different formats, and you need to standardize or convert them for further processing, display, or integration with other systems.
Common scenarios:
- Converting user-inputted dates into ISO 8601 format for database storage.
- Formatting dates for reports or emails.
- Parsing ambiguous date strings by specifying possible input formats.
Practical example:
If you receive a date as "31.12.2023" and want it in "YYYY-MM-DD" format, this node can handle the conversion, even if the input format varies.
Properties
| Name | Meaning |
|---|---|
| Date | The date to format. If "Formats to test" is not provided, your date needs to be in one of the following formats: 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. |
| Output Format | The desired output format for the date (e.g., YYYY-MM-DD, MM/DD/YYYY). |
| Formats to test Input Mode | How to provide the list of possible input formats. Options: Expression (provide as JSON array), Manual (enter formats manually). |
| Formats to test | The formats the date can be in. If using "Expression", provide as a JSON array; if using "Manual", enter multiple values. |
Output
- json: The output will contain the formatted date according to the specified "Output Format".
- If successful, the output will typically include a field with the reformatted date (the exact key depends on the API response).
- If an error occurs, the output will include an
errorfield with details about the issue.
Example output (success):
{
"formattedDate": "2023-12-31"
}
Example output (error):
{
"error": "Invalid date format"
}
Dependencies
- External Service: Requires access to the 1001fx API.
- API Key: You must configure the
1001fxApicredential in n8n. - Environment: No special environment variables required beyond n8n's standard configuration.
Troubleshooting
Common issues:
- Invalid date format: If the input date does not match any of the expected formats, the node will return an error. Ensure your "Date" property matches one of the specified formats or provide the correct formats in "Formats to test".
- Missing API credentials: If the
1001fxApicredential is not set up, the node will fail to authenticate. - Incorrect output format: If the "Output Format" is invalid or unsupported, the API may return an error.
Error messages:
"Invalid date format": The input date could not be parsed. Check your input and the "Formats to test"."Missing required parameter": One of the required properties was not provided."Authentication failed": The API key is missing or incorrect.
Links and References
- 1001fx API Documentation
- n8n Documentation: Custom Nodes
- Date formatting reference (Moment.js) (for common format strings)