When I use the date-picker to fill in a form field about data/time, everything seems normal, but in the submitted data, the year is always missing and is displayed with ‘yyy’ (not 4, but 3), so the result is for example 05/04/yyy.
Is there a way I can fix/avoid this? It was not crucial for my app before, but I now need it and I can’t get it to work. Recreated the flow, created new flows, etc. Always the same result.
Information on my n8n setup
n8n version: 1.85.4 (but I have this already for months)
Good point. After your remark, I tested it in Edge in Windows, Chrome in Windows and Ubuntu, Mobile Chrome, Mobile Edge and Firefox in Windows and in Ubuntu, all with the same results. Their date settings are not browser dependent, but set by the OS. I have chosen different settings in my tests, but they do not influence the results.
And what I just saw, is that even when I fill the dates in by hand, the same effect applies, so it’s not determined by using the date picker pop-up, but just the field itself.
I can’t seem to find out what causes this. Very open to suggestions!
Thanks for your support @mohamed3nan ! Very much appreciated.
Yes, the time/date node works. If I ask for the current date/time I do receive the correct response.
If I use my form input for a date and then in the next step extract the year with the time/date node then I do get an error (which isa not surprising since the input is alike 01/01/yyy.
NodeOperationError: Invalid date format at ExecuteContext.parseDate (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/DateTime/V2/GenericFunctions.js:46:19) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/DateTime/V2/DateTimeV2.node.js:189:69) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:50) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:913:62 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20
Please just use this node as it is in new workflow and screenshot the output to just know where the issue exists exactly, sounds like the date picker for now…
I’m rebuilding it now: I noticed that the output format in my erroneous from different is from the one that you sent (dd/mm/yyyy) vs (yyyy-MM-DD).
I’m not sure yet what the impact of that is, but the form I’m building now seems to have the latter format and that works correctly… No idea how the original form outputs in another format…
I have rebuilt the complete form now, and now it works. Earlier I copied the node in new flows, but I guess I copied - whatever error is in there - with it.
@jcuypers I’m working on this flow for months now, so I don’t remember if I copied it as a flow at the start, but it’s very well possible and a likely explanation; I did do that sometimes. I guess then the node has embedded another date format somewhere and that went wrong.
Your help is very much appreciated; I would have not solved this myself. Thank you @mohamed3nan !