"From time" cannot be later than "To time" and hours cannot be negative

Assuming hours cannot be negative in a time log:
In time log if hours are set negative then from_time is set later datetime than to_time.
If from_time is set later than to_time, hours become negative.