Convert a date string to a timestamp
Convert a date string to a Unix timestamp with GNU date -d 'string' +%s. The zone is the one in TZ unless the string names one, so set it explicitly.
A log line holds a human readable date and you need the number of seconds since 1970 to compare or subtract.
date -u -d '2026-03-05 14:00:00' +%s
TZ=UTC date -d '2026-03-05 14:00:00' +%s
TZ=Asia/Tokyo date -d '2026-03-05 14:00:00' +%s
date -d '2026-03-05 14:00:00 +0900' +%s1772719200
1772719200
1772686800
1772686800-d parses a date string and %s prints it as epoch seconds, using the grammar in the GNU date manual. Without an explicit offset the string is read in the zone from the TZ variable or the system setting, so the Tokyo run is nine hours earlier than the UTC runs. Naming the offset in the string, as in the last line, removes the dependence on the machine.
This is GNU date. BSD and macOS date do not have -d, and date -j -f is the equivalent there. Strings such as "next friday" are accepted too, but they depend on today's date, so keep them out of scripts that must be reproducible.