Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add two time in coldfusion

I am trying to find end time with duration and start time using ColdFusion.
What I have tried is :

<cfset st_time=timeFormat("05:00:00",'hh:mm:ss tt')>
 <cfset s_d=listToArray(duration,":")>
  <cfset hours=s_d[1]>
  <cfset min=s_d[2]>
  <cfset sec=s_d[3]>
   <cfset new_time = TimeFormat(createTime(hours, min, sec))>

Expected Output

start_time="05:00:00 PM"
duration="02:30:00"
then end_time should be 07:30:00 PM 

how to calculate end time like this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Step 1 – Covert your duration to seconds.

Step 2 – Use ColdFusion’s DateAdd function to calculate the end time.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading