# Copyright (c) 2025-2026 Gigasoft, Inc. All rights reserved. === ProEssentials Date/Time (knowledge rev 4) Handling === ProEssentials supports date/time X-axes through serial date values. Enable DateTimeMode on PeData, then pass dates as OLE Automation doubles. SERIAL DATE FORMAT: C#: double serialDate = myDateTime.ToOADate(); This produces a double where the integer part = days since Dec 30, 1899 and fractional part = time of day (0.5 = noon). ProEssentials renders these as formatted date/time axis labels. PESGO DATE/TIME: 1. Set PeData.DateTimeMode = true 2. Set PeData.X[s, p] = dateTime.ToOADate() for each point 3. ProEssentials auto-detects appropriate date format from data range 4. Fine-tune with YearMonthDayStyle, TimeLabelsOnDataBoundary, etc. PEGO DATE/TIME: 1. Set PeData.DateTimeMode = true 2. Set PeData.DeltaX = serial interval between points Daily: DeltaX = 1.0 Hourly: DeltaX = 1.0/24.0 Monthly: DeltaX = 30.0 (approximate) or use DeltasX[] for variable 3. Set a StartTime reference point 4. PointLabels are auto-generated from dates VARIABLE TIME STEPS (Pego): Use DeltasX[] array for non-uniform intervals. DeltasX[i] = interval between point i and point i+1 in serial days. Useful for: trading days (skip weekends), irregular sampling. CUSTOM DATE FORMATTING: For full control, disable DateTimeMode and use the PeCustomGridNumber event. In the handler, convert the numeric grid value back to DateTime and format with any .NET format string. See example 132. DATE FORMAT PROPERTIES: YearMonthDayStyle -- date component ordering DateTimeLabelType -- controls which date parts show TimeLabelsOnDataBoundary -- snap labels to data points vs. round numbers KNOWN QUIRK: The DateTimeMode property maps to DLL constant PEP_nDATETIMEMODE. The unified-docs JSON has a mapping anomaly (maps to DateTimeShowSeconds). The enriched JSON correctly shows PeData.DateTimeMode as type bool. In code, set it as a boolean: PeData.DateTimeMode = true; KEY: pe_query.py props "DateTimeMode,DeltaX,YearMonthDayStyle"