Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

DateTime

edited October 2023 in OpenInsight
I am experimenting with creating an MD hook entry to intercept TCL select commands.
I want to use the Q syslists record to see if the last entry was selecting records, but I need to match the time&date from the TCL last command.
I see this in the SYSLISTS Q record But I dont know how the highlited datetime value is created.
I tried Idate.iTime the result I pasted in row 7 (got from doing a 'ogit' call). SRP editor oconv gets it right, so must be a legit iDateTime.
So, how do I create that value:?


Comments

  • Time in datetime is a decimal not a time().
    Check out https://wiki.srpcs.com/display/SRPUtilities/SRP_DateTime
  • @AusMarkB not sure what option you are pointing me to.

    Maybe if I rephrase the question.

    How do I get this:


    to look like that:

  • Since the portion after the period in DateTime represents the fraction of an entire day, you can extract the formatted time (07:30:59AM), get the number of seconds it represents using MT conversion, and then divide this by the total number of seconds in a day (86,400). This will produce the fractional value you can append to your internal date value. There is a little bit of massaging you'll have to do but the above steps are basically how you do it.
  • Alternatively, you can just use SRP_DateTime's Parse service:
    oDateTime = '10/15/2023 07:30:59AM' iDateTime = SRP_DateTime('Parse', oDateTime)
  • @DonBakke Great , thanks that worked for me.
    AfterOTimeDate =timedate() swap " " with @fm in AfterOTimeDate oDateTime = AfterOTimeDate<2> :" ": AfterOTimeDate<1> iDateTime = SRP_DateTime('Parse', oDateTime)

Sign In or Register to comment.