dateUtils Reference
Module defined in `lua/common/utils/dateUtils.lua`. ISO 8601 date parsing and time difference calculations.
Module defined in lua/common/utils/dateUtils.lua. ISO 8601 date parsing and time difference calculations.
Exports
Functions
M.parseIso8601(datetime)
Parse an ISO 8601 date-time string to a Unix timestamp. Supports standard format (...T...Z) and AM/PM fallback format (...T...AMZ/...T...PMZ). Returns current time on parse failure.
- Parameters:
datetime- string - ISO 8601 formatted string (e.g., "2024-01-15T10:30:00Z")
- Returns: number - Unix timestamp (via
os.time)
M.timeSince(datetime)
Calculate elapsed time since an ISO 8601 date-time string.
- Parameters:
datetime- string - ISO 8601 formatted string
- Returns: number - Seconds elapsed since the given time
Internal Notes
- Uses pattern matching to extract year/month/day/hour/min/sec from ISO 8601
- Has AM/PM fallback pattern for broken formatting
- Logs error and returns current time if parsing fails entirely
timeSincecallsparseIso8601internally, gets current UTC time viaos.time(os.date("!*t")), then usesos.difftime
calltracer Reference
Module defined in `lua/common/utils/calltracer.lua`. Records function call graphs using Lua's debug hook, exports to TGF format for visualization in yEd.
debugDraw Reference
Module defined in `lua/common/utils/debugDraw.lua`. Lightweight debug drawing API using packed integer colors instead of ColorF/ColorI. Wraps FFI calls to the C++ `BNG_DBG_DRAW_*` functions.