๐—ง๐—ถ๐—บ๐—ฒ ๐— ๐—ฎ๐˜๐—ต ๐—œ๐˜€ ๐—›๐—ฎ๐—ฟ๐—ฑ๐—ฒ๐—ฟ ๐—ง๐—ต๐—ฎ๐—ป ๐—œ๐˜ ๐—Ÿ๐—ผ๐—ผ๐—ธ๐˜€

Adding durations sounds simple. 2:45 plus 1:30 seems easy. Then a user logs 11:45 PM to 7:15 AM. Your code says they worked negative 16 hours. Time math is tricky.

Avoid these 6 common bugs:

Stop doing math on strings or local times. Use this pipeline:

This system stops surprises.

Source: https://dev.to/anh_qunnguyn_57549060f/time-math-is-harder-than-it-looks-6-duration-bugs-and-how-to-avoid-them-3j8m