We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

How to display the current date and time

kristiakkristiak Posts: 1,334 ✭✭✭

I know current date and time is logged in the audit file when a  variable is updated or created.  How can I get SYSDATE and SYSTIME to be shown as defaults values in the CRF during data entry?  For example I would like to display the current date and time as a default for each lab value entered on the lab CRF. 

I have tried with some java strings but no luck!

Best regards



  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    I think that is one of the main use cases for the instant-calculation
    field, explained in the docs. Although it might be client time, not server

    If you can use JavaScript to store a timestamp with timezone, this could be
    normalised to a particular timezone during analysis, or possibly even
    modified up front if you can read the site name from the CRF header.
  • GerbenRienkGerbenRienk Posts: 814 ✭✭✭
    Hi Krister,
    I agree with Lindsay. 
    If however you would like to have today's date in a normal OC-Date-field plus the time in a text-field, the attached CRF should do the trick.
    Gerben Rienk
  • kristiakkristiak Posts: 1,334 ✭✭✭

    Thanks Gerben and Lindsay, This is exactly what I was looking for but I could not find it in the manual. Gerben many thanks for the rapid and detailed response.

    est regards


  • kristiakkristiak Posts: 1,334 ✭✭✭

    I have now tested this in one of our CRF's and it works exactly as anticipated. Thanks again Gerben, you are a wizard, I would never have figured out the lengthy code needed for the data part :)

    Best regards


This discussion has been closed.