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

Adding durations seems easy. 2:45 plus 1:30 is simple. Then a bug appears. A user works from 11:45 PM to 7:15 AM. Your code says they worked negative 16 hours.

The obvious answer is often wrong.

Here are six common time bugs.

Most bugs come from doing math on strings or local times. These formats are not additive.

Use this pipeline.

This process stops time bugs.

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