Date&Time input node execution time inconsistency

I’m working on something that requires UTC execution time, so I’ve developed this part of the workflow. The problem is the results that the first node gives me is inconsistent through different executions. This breaks the string to date&time node later on. After some trial and error, I’ve noticed the results I’m getting is either one of these:

yyyy-MM-dd’T’HH:mm:ss[.SSS]VV[‘[‘zzzz’]’]
yyyy-MM-dd’T’HH:mm:ss[.SS]VV[‘[‘zzzz’]’]

Can anyone explain to me why the node sometimes gives me the millisecond (I think?) in 3 AND 2 digits? What’s a possible solution for this?

Thanks for reading!

image

Hello @Muzume,

Think because third digit is zero and thus not shown/written.

Use Create Date&Time Range node to get current execution time and avoid converting string to Date&Time format.

Br,
Ivan

4 Likes

Hi @Muzume,

You can also handle this in the later node by allowing optional elements to the format mask as follows.

Replace [.SSS] with [.SSS][.SS][.S]

You could also use M and d for month and day respectively as this gives more flexibility too as they then show both single and 2 digit month and day but I cannot recall if that occurs with the Date&Time execution time.

3 Likes

Thanks @ipazin @takbb for the help. I’ve implemented Ivan’s solution, but just for clarity’s sake, the third digit isn’t zero during my tests. The other masking solution also works great.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.