Hi Eytan
If you do this in the the UI the time entry will auto split for you across the midnight, you can then choose to fix it up manually if you want all hours on one of the 2 days.
However if you are doing this via customizations you (or whoever wrote the rule) probably have not taken this scenario into consideration.
Can you paste in the formula that creates the new object?
Thanks,
David
Customer Success Manager
Clarizen