Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • CDMS
  • Castor CDMS Calculations Manual
  • Calculations with date and time

Calculate the duration using time fields in EDC/CDMS

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • CDMS
    Castor CDMS Manual Castor CDMS Calculations Manual Frequently Asked Questions Articles for Data Managers Castor CDMS Compliance Release Documents
  • eConsent
    Castor eConsent Manual Castor eConsent Compliance Release Documents
  • SMS
    Castor SMS Manual Castor SMS Compliance Release Documents
  • Castor Connect
    Castor Connect Compliance Release Documents Castor Connect Manual Castor Connect - Participant Quick Start Guide
  • Helpdesk
    News Other Resources Castor products knowledge resources
  • Status page
  • Completing a Study
+ More

To calculate the total duration of the several time variables and output the duration in hours and minutes, use the following calculation template:

 

var time1 = moment.duration('{time_var1}').asMinutes();
var time2 = moment.duration('{time_var2}').asMinutes();
var time3 = moment.duration('{time_var3}').asMinutes();
var total_min = time1 + time2 + time3;
var minutes = total_min % 60;
var hours = (total_min - minutes)/60;
hours + ':' + minutes;

 

Adjust the variables time_var1, time_var2 and time_var3 which are between the brackets and add more variables to the var total_min.

You can check this code in the calculation helper here.

time fields duration calculation

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Doing date (and time) calculations in EDC/CDMS: the basics
  • Check if year is in the future in EDC/CDMS
  • Show a message in EDC/CDMS when the date is more than X days before today or in the future
  • Adding hours or minutes to a time field in EDC/CDMS
ISO 27001
FDA - 21 CFR part 11
ICH GCP compliant
HIPAA compliant
CDISC
ISO 9001
gdpr compliant

Products & Industries

  • Electronic Data Capture (EDC)
  • ePRO
  • eConsent
  • Decentralized Clinical Trials (DCT)
  • Clinical Data Management
  • Medical Device & Diagnostics
  • Biotech & Pharma
  • CROs
  • Academic Research

Resources

  • Thought Leadership
  • Blog
  • Castor Academy
  • Knowledge Base

 

Company

  • About Us
  • Careers
  • News
  • Contact Support
  • Contact Us

Legal & Compliance

  • Terms of Use
  • Privacy & Cookie Statement
  • Responsible Disclosure Policy
  • Good Clinical Practice (GCP)
  • ISO Compliance Certificates
  • GDPR & HIPAA Compliance
  • Security Statement

© 2022, Castor. All Rights Reserved.

Follow us on social media


Knowledge Base Software powered by Helpjuice

Definition by Author

0
0
Expand