Date formatting error using date functions

I’m getting a date formatting error using Make date functions. Is anyone across this who can help me make sense of what I’m getting wrong here?

I’m trying to use both the setHour and setMinute functions but could certainly be putting them together incorrectly. I’m using them individually without issue but perhaps it’s the way I’m combining them?

Seems like you are getting Date as a String in the mapping causing the error. You will need to use parseDate and then do other operations.

You have incorrectly used the setHour function. also, please check the variable “Properties_value.Date.start” is in the date data type.

Thanks Fasil. Could you please explain how I have used the setHour function wrong? I am sure that “Properties_value.Date.start” is in the date data type. I can use it on it’s own with no problems. It’s only when I try and combine it with the setMinute function that I’m running into problems.

Thanks again for your help.

Thanks Runcorn. I haven’t used the parseDate function before. I’ll give it a try. Thanks!

the second parameter inside the setHour function and setMinutes function should be a number.

If you tell me what you are trying to do with these
functions and what is required output, then i will try to set these functions properly.

Thanks again for your help Fasil.

I am using these functions to add the time to a date in a Notion database. I have it working perfectly when I configure it like this, however I’m only able to set the hour and not the minutes with this approach.

The second parameter I’m using is coming from Notion and contains a number.
CleanShot 2023-06-22 at 08.49.45@2x

The end result I’m trying to achieve is to add the hour and minutes to my existing date.

Thank you.

Now use the setMInute() as below:
setMinute(“the above, entire setHour function operation”;final starts minutes)

This will solve your issue.

1 Like

Thanks so much! Worked nicely. I was nesting the function inside each other incorrectly. Really appreciate your help!

1 Like

@timjeffries I am glad to hear that my solution helped you.