Can someone look at this - is there a problem with the `moment` node?

Thanks.

It isn't I am blaming anyone - or I don't want to, if it seems I am.

Yes, I am maybe of the wrong mind-set, but I am what I am.

I may have to sit down and work out a specific way to do what I need.

It is just I was trying to write some code to answer someone else's question which was basically how to get a display of time interval.

If you fancy an excercise, I've always wanted to add an interval node to the moment nodes :slight_smile:

I shall put some serious effort into looking at the moment node (maybe later today) and see if I can work out a trick to get around the timezone problem.

The problem is that an elapsed time is not the same thing as a time.

What would you expect moment to output if the elapsed time was 25 hours?

If you have an elapsed time of 5000 millseconds, moment will presumably interpret that as very early on 1st January 1970.
Change the output format to dddd, MMMM Do YYYY, hh:mm:ss and test it.

It doesn't "suddenly" apply the timezone correction when you add hh, it was always there but the difference is (usually) a round number of hours so it doesn't show up.

1 Like

Well, that is true, but unless you are wanting to deal with values of greater than (let's say) a week....

There isn't a problem.

Sorry, I had missed the fact that you are trying to show a time difference.
If you set the input and output timezones to UTC and the format to HH:mm:ss then it works correctly for me. So with an input of 3600000 (1 hour in milliseconds) then it shows "01:00:00".
That should work whatever timezone you are in, up to a time difference of 23:59:59. It obviously won't work above that.

I've dug into the code and there is already a 'difference' variable used.

But I am really out of my depth as I know nothing about how to make nodes.
I shall have to read up on that too soon.

But in light of all the information I was given I wrote a hack job for the required result.

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