Plex 2E

 View Only
  • 1.  cpp construct timestamp from dateiso and timeiso

    Posted May 09, 2025 07:35 AM

    Hello,  Does anyone have cpp source code to contruct timestamp from parts,  mostly dateiso and timeiso.  

    Thanks. 



  • 2.  RE: cpp construct timestamp from dateiso and timeiso

    Posted May 12, 2025 10:27 AM

    Here is a line of C++ code that constructs a timestamp from parts.  The first parameter is TimeStampISO, then Year, Month, Day, Hour, Minute and Second.  In our model all fields come from the fields model.

    As C++:
         &(1:) = ObTimeStampFld(&(2:),&(3:),&(4:),&(5),&(6),&(7));

    The template for this is found in the OBTIME.H file in the c:\program files (x86)\CA\Plex\7.2.1\include directory (or equivalent).  There does not appear to be a function for creating a timestamp from a date and a time, so you have to use the DateISOToDateStructure and TimeISOToTimeStructure functions first, or you could do something like the following.  The first parameter would be TimeStampISO, the DateISO, then TimeISO.  I have not tested this line, so there may be syntax errors.
         &(1:) = ObTimeStamFld(&(2:).GetDateYear(), &(2:).GetDateMonth(), &(2:).GetDateDay(), &(3:).GetTimeHour(), &(3:).GetTimeMinute(), &(3:).GetTimeSecond());