Hello Experts! Thank you in advance for your valuable time. I am trying to create an appended date and time field. When I add DateTimeAdd to the formula, my time disappears. I've tried each field on it's own and they populate as expected. I have three different fields and they all work as expected, except, when I add DateTimeAdd. What am I doing wrong? The correct date and time in my attached examples should be 2020-04-03 01:00:00.
Solved! Go to Solution.
Hi @jenv20032000x,
This formula should work for you:
DateTimeAdd(DateTimeAdd(DateTimeNow(),1,'day'),1,'hour')
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
HI @jenv20032000x try this:
it's because datetimeadd creates a date time, so to add your time string you need to ignore the time part of the date time
Thank you both so much! Both solutions worked. I greatly appreciate the assist.
Hello,
I'm having problems with the DateTimeAdd when using in the formula tool. I assume my field is formated correctly because I can take that field and another time field and do a DateTimeDiff...
I tried this but it only generated Nulls... not sure what I'm doing wrong. Note: the data is Time only.
DateTimeAdd([Sunset_Out], 12, "hours")
I ended up having to do this which seems like a workaround... and I got the result I wanted but I want to know why DateTimeAdd didn't work... please help me understand so I know how to use it in the future.
ToString((ToNumber(Substring([Sunset_Out],0,2))+12), 0)+Substring([Sunset_Out],2,6)
I had the same issue when working on challenge 68. I'm wondering if it is because it is only hh:mm:ss rather than the full date??? Annoying because it seems like it should work.