From Jalali
AI-generatedOverview
This node converts Persian (Jalali) dates to the Gregorian calendar. It supports inputting the date either as a complete Persian date string or as separate year, month, and day values. The node then outputs the corresponding Gregorian date in various formats, such as ISO string, timestamp, localized string, and more. This is useful for workflows that need to handle Persian calendar dates and convert them to standard Gregorian dates for further processing or integration.
Use Case Examples
- Convert a Persian date string '1402/12/25' to a Gregorian ISO date string for database storage.
- Input separate Persian year, month, and day values and get the Unix timestamp for scheduling events.
- Convert Persian dates to localized strings for display in user interfaces.
Properties
| Name | Meaning |
|---|---|
| Input Type | The format of the input date, either a complete Persian date string or separate year, month, and day values. |
| Date | Persian date in YYYY/MM/DD format, used when input type is 'Complete Date'. Can use Persian or English numerals. |
| Year | Persian calendar year, used when input type is 'Separate Values'. |
| Month | Persian calendar month, used when input type is 'Separate Values'. |
| Day | Persian calendar day, used when input type is 'Separate Values'. |
| Output Format | The format of the output Gregorian date, with options to return all formats or specific formats like ISO string, timestamp, localized string, etc. |
Output
JSON
isoString- Date in ISO 8601 string formattimestamp- Date as Unix timestamp in millisecondstimestampSeconds- Date as Unix timestamp in secondsdateString- Date as a human-readable stringlocalizedString- Date in localized string format based on system localestandardString- Date in standard YYYY/MM/DD formatutc- Date in UTC string formattime- Time portion of the date as a stringdate- Date in the selected single output format
Dependencies
- moment-jalaali library for Persian date parsing and conversion
Troubleshooting
- Ensure the Persian date input is not empty when using 'Complete Date' input type.
- When using 'Separate Values' input type, year, month, and day must all be provided and non-zero.
- Input Persian date must be valid and correctly formatted; otherwise, the node throws an 'Invalid Persian date format or values' error.
- If the node is set to continue on fail, errors will be included in the output JSON under the 'error' property.