Actions108
- AI Actions
- Transcribe
- Detect Brand
- Extract Contact Information
- Mood Detection
- Detect Adult Content
- Enitity Detection
- Language Detection
- Too Long To Read
- Check Content Policy
- Detect Faces
- Generate Python Code
- Picture Text Recognition
- Detect Color
- Generate Image
- PDF OCR
- Translation
- Detect Email Type
- Generate Javascript Code
- Picture Object Recognition
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Overview
The "Switch Time Zone" operation of the Date & Time resource in this node converts a given input time from one specified time zone to another. This is useful when working with timestamps or scheduling events across different geographic regions, ensuring that times are correctly interpreted and displayed according to the desired local time zone.
Common scenarios include:
- Converting user input times into a standard time zone for storage or processing.
- Displaying event times in the viewer's local time zone.
- Adjusting timestamps in data pipelines that aggregate information from multiple time zones.
For example, if you have an event scheduled at "2024-06-01 15:00" in New York (Eastern Time), you can convert it to Tokyo time to notify participants there accurately.
Properties
| Name | Meaning |
|---|---|
| Code Variables | A collection of code variables defined in the code editor, each with a variable name/ID and its corresponding value. |
| Input Time | The original time string that you want to convert from the source time zone. |
| Input Time Zone | The time zone identifier of the input time (e.g., "America/New_York"). |
| Destination Time Zone | The target time zone identifier to which the input time should be converted (e.g., "Asia/Tokyo"). |
| Format Pattern | Optional pattern string defining how the output time should be formatted (e.g., "YYYY-MM-DD HH:mm:ss"). |
Output
The node outputs JSON data representing the converted time in the destination time zone. The exact structure depends on the underlying API response but typically includes the converted time string formatted according to the provided pattern or default formatting.
If binary data were involved, it would be summarized here; however, this operation deals only with time strings and does not output binary data.
Dependencies
- Requires an API key credential for the external service powering the "0CodeKit" node operations.
- The node makes HTTP POST requests to the service endpoint corresponding to
dateandtime/switchtimezone. - No additional environment variables are explicitly required beyond the API authentication.
Troubleshooting
- Invalid Time Zone Identifiers: If the input or destination time zone strings are invalid or unrecognized, the node may throw errors or return incorrect results. Ensure time zones follow standard IANA time zone database names (e.g., "Europe/London", "America/Los_Angeles").
- Incorrect Input Time Format: Providing an improperly formatted input time string may cause parsing failures. Use ISO 8601 or other recognized date-time formats.
- Missing Required Parameters: All of
Input Time,Input Time Zone, andDestination Time Zoneare required. Omitting any will result in errors. - API Authentication Errors: If the API key credential is missing or invalid, the node will fail to execute. Verify credentials are configured properly in n8n.
- Continue On Fail Behavior: If enabled, the node will continue processing subsequent items even if some fail, returning error messages in the output JSON.
Links and References
- IANA Time Zone Database
- Date and Time Formatting Patterns
- n8n Expressions Documentation (for using expressions in variable definitions)