RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library
Call TracerDate UtilsDebug DrawingFilter Chainutils/ - Utility ModulesHeatmap GeneratorHTTP JSON ServerInteractive ShellLanguage MapPerformance ProfilerPixel Drawing LibraryHTTP ServerTorqueScript ParserWebSocket Server

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommonutils

Date Utils

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
      ")
  • 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
  • timeSince calls parseIso8601 internally, gets current UTC time via os.time(os.date("!*t")), then uses os.difftime

See Also

  • utils/ - Utility Modules - Directory overview
  • calltracer Reference - Related reference
  • debugDraw Reference - Related reference
  • filterchain Reference - Related reference
  • Common Libraries Overview - Guide

Call Tracer

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.

Debug Drawing

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.

On this page

ExportsFunctionsM.parseIso8601(datetime)M.timeSince(datetime)Internal NotesSee Also