How to convert time into seconds - InfoPath Dev
in

InfoPath Dev

How to convert time into seconds

Last post 12-01-2014 12:51 AM by donstephen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-04-2014 07:15 AM

    How to convert time into seconds

    Hello,

    I have two questions.

    1 - I have created a form wherein the time is in format of 00:35:15 how can i convert it in seconds.

    2 - Is there is any possiblity to disable the Ctrl+Z function to avoid data furging.

    Thanks for your support.

    regards,

    Upender Singh

    Regards,

    Upender Singh
  • 12-01-2014 12:46 AM In reply to

    Re: How to convert time into seconds

    Hi Upender,

    The formula below extracts the minutes section from the TimeField and then multiplies it to 60. After the minutes portion of the TimeField has been converted to seconds, I then extracted the seconds portion and simply added it to the previous data.

    (substring-before(substring-after(TimeField, ":"), ":") * 60) + (substring-before(substring-after(substring-after(TimeField, ":"), ":"), "+"))

    where TimeField is the field which holds the time.

    You can also perform this approach to the hours portion - extract the hours and then multiply it to 3600, then add this value to the other values (formula above).

    I haven't encountered any way yet to disable the CTRL + Z function since this is a global command or a hot key of some sort.

    Hope this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 12-01-2014 12:51 AM In reply to

    Re: How to convert time into seconds

     Or better yet, use this formula instead:

    substring(TimeField, 1, 2) * 3600 + substring(TimeField, 4, 2) * 60 + substring(TimeField, 7, 2)

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.