Commit Graph
15 Commits
Author SHA1 Message Date
Jash 05adc0000d fix: unparseable DB times read as the epoch, time strings returned with their text, NULL tag CreateDate handled refs #6465 2026-11-16 17:44:04 +05:30
Jash 358f0199ec fix: read daylight saving wall clock times correctly in zms datetime and StringToSystemTimePoint refs #5772 2026-11-14 18:13:39 +05:30
Isaac ConnorandClaude Opus 4.8 62ff384855 fix: store event StartDateTime with second precision to match disk path refs #4870
SystemTimePointToMysqlString appended ".%06d" microseconds to the string it
hands MySQL for the Events.StartDateTime datetime column. That column has no
fractional precision, and MySQL 8 ROUNDS a fractional value when storing it, so
a start_time of 23:59:59.5xx-.999999 local was promoted to 00:00:00 of the next
day. Event::SetPath() derives the on-disk day folder from to_time_t(start_time),
which truncates, so it landed on the previous day.

For continuous recording the event start is backdated to the preceding keyframe,
which for a section forced closed at local midnight falls just before midnight.
On MySQL 8 the DB row then recorded the next day while the files were written
under the previous day's folder, producing a permanent zmaudit path mismatch and
orphaned files when the event aged out (the purge path is built from
StartDateTime).

Format the value to whole seconds only so it matches to_time_t() used by
SetPath(), keeping the DB row and the disk folder on the same second regardless
of whether the DB engine rounds or truncates.

Add tests/zm_time.cpp covering the floor-not-round behaviour and consistency
with the to_time_t-derived path second.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 08:42:10 -04:00
Isaac ConnorandClaude Opus 4.6 2e2e9576ac refactor: move format_absolute_time_iso8601 from zm_monitor_onvif to zm_time
Move the ISO 8601 time formatting function to zm_time.cpp/h so it is
reusable and not duplicated. Remove the local copies from
zm_monitor_onvif.cpp (was static) and tests/zm_onvif_renewal.cpp
(was a copy for testing). Both now use the shared declaration from
zm_time.h.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 16:53:39 -05:00
Isaac Connor 7ddd404308 Introduce SystemTimePOintToMysqlString 2026-01-24 11:17:57 -05:00
Isaac Connor ba46bafcbf Add SystemTimePoint StringToSystemTimePoint(const std::string &timestamp) 2025-06-12 09:39:08 -04:00
Aaron Kling c4683d90a9 Format code using astyle google format
Commands used:
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h
2024-03-26 13:43:58 -05:00
Doug Nazar df414fc028 Need to cast duration to system_clock resolution. 2022-07-16 10:03:54 +00:00
Isaac Connor 1bc0e1820e fix build on older c++ 2021-12-16 17:02:20 -05:00
Isaac Connor 7b7ac8fc7e Add utility functions TimePointToString and SystemTimePointToString 2021-12-16 16:30:26 -05:00
Peter Keresztes Schmidt 6c68397249 Time: Convert some timeval operations to std::chrono
Also remove now defunct timeval helper methods.
2021-06-07 23:53:53 +02:00
Andy Bauer 254fcbcef7 update gpl 2 mailing address in source files 2016-12-26 09:23:16 -06:00
stan e6041e24a7 Uppdated copyright headers
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2611 e3e1d417-86f3-4887-817a-d78f3d33393f
2008-07-25 09:33:23 +00:00
stan f6a029bc4d Updated properties
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2608 e3e1d417-86f3-4887-817a-d78f3d33393f
2008-07-25 09:08:15 +00:00
stan aa26ab7b18 git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2532 e3e1d417-86f3-4887-817a-d78f3d33393f 2008-07-16 08:35:59 +00:00