How do I figure out what format of timedate string I have to compare?
I receive an authorization token for a process with a 24 hour timeout. Regenerating the token can cause failures in my workflow. So, I want to write the token and the expiration date to a file local to my n8n instance. Generating and writing are all working well. I can also read the file.
The token has a 24hour lifespan. So logically, I should be able to read the token from the file, check the expiration date, return to the calling flow if it has not expired, or regenerate, store, then return the updated token if the first is expired.
My issue is the date format. What I get is ‘Sun, 04 Feb 2024 00:34:27 GMT’. The error message indicates it’s not recognized.
None or “ERROR: The provided value 2 ‘Sun, 04 Feb 2024 00:34:27 GMT’ in condition 1 cannot be converted to the expected type ‘dateTime’ [item 0]”
Please share your workflow
Share the output returned by the last node
[
{
"data":
[
{
"kgApiAuthBearer":
"Bearer
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MDY5MjI5NDYsImV4cCI6MTcwNzAwOTM0NiwiaXNzIjoiTW9zeWxlIiwiZGF0YSI6eyJVc2VySUQiOiIzODQyMTE4IiwiZW1haWwiOiJydXNzZWxsQGtnaW5nZXIuY29tIn19.eToA0CXLzxl61xLyzRktyVpulNQMg8JIPipcvHqxIfc",
"kgApiAuthExpires": "Sun, 04 Feb 2024 01:15:46 GMT"
}
]
}
]
Information on your n8n setup
- n8n version: 1.26.0
- Database (default: SQLite): PostgresQL
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker in Digital Ocean
- Operating system: Ubuntu 22.04.3 LTS