Appwrite Helper icon

Appwrite Helper

Utility node for building Appwrite queries, permissions, and schemas

Overview

This node operation formats a given date input into various specified output formats. It supports input dates in ISO string, timestamp, or Date object formats and can convert them into ISO 8601, date only, time only, combined date and time, Unix timestamps (in milliseconds or seconds), or relative time formats. This is useful for workflows that require date normalization, display formatting, or timestamp conversions for further processing or integration.

Use Case Examples

  1. Converting an ISO date string to a Unix timestamp for database storage.
  2. Formatting a timestamp into a human-readable relative time like '5 minutes ago' for notifications.
  3. Extracting only the date or time portion from a full datetime input for reports or logs.

Properties

Name Meaning
Date Input The input date to be formatted, which can be an ISO string, timestamp, or Date object.
Output Format The desired output format for the date, such as ISO 8601, date only, time only, combined date and time, Unix timestamp in milliseconds or seconds, or relative time.

Output

JSON

  • formattedDate - The formatted date/time string or timestamp according to the selected output format.

Troubleshooting

  • Ensure the input date is in a valid ISO string, timestamp, or Date object format to avoid parsing errors.
  • If the output format is 'Relative', the node may require the current system time to calculate the relative difference correctly.
  • Errors may occur if the input date is empty or malformed; validate input before processing.

Discussion