7 Replies Latest reply: Nov 14, 2016 12:40 PM by Sunny Talwar

# Convert Time into minute

Hi

i have field as follows

Time

1Day20Hrs30Min25Sec

2Day20Hrs45Min25Sec

1Day24Hrs30Min25Sec

1Day16Hrs30Min25Sec

3Day14Hrs30Min25Sec

I want to convert the above field into HH:MM:SS

Can anyone help me?

• ###### Re: Convert Time into minute

Hi,

What do you want to see ?  Something like this :

1Day20Hrs30Min25Sec = 44:30:25

2Day20Hrs45Min25Sec = 68:45:25

• ###### Re: Convert Time into minute

yes

• ###### Re: Convert Time into minute

Hi Gourav

=SubField('1Day20Hrs30Min25Sec','Day',1)*24+TextBetween('1Day20Hrs30Min25Sec','Day','Hrs')&':'
&TextBetween('1Day20Hrs30Min25Sec','Hrs','Min')&':'&TextBetween('1Day20Hrs30Min25Sec','Min','Sec')  -> 44:30:25

Regards,

Antonio

• ###### Re: Convert Time into minute

I would also add the interval#() function to assign the timestamp a dual representation

Interval#(SubField('1Day20Hrs30Min25Sec','Day',1)*24+TextBetween('1Day20Hrs30Min25Sec','Day','Hrs')&':'

&TextBetween('1Day20Hrs30Min25Sec','Hrs','Min')&':'&TextBetween('1Day20Hrs30Min25Sec','Min','Sec'), 'hh:mm:ss')

• ###### Re: Convert Time into minute

Hi sunny

this code is hard code ,

their are multipal rows in the table , How we can apply for all rows in that field

• ###### Re: Convert Time into minute

I guess Antonio and I meant for you to replace the hard-coded values with the field name:

Interval#(SubField(FieldName,'Day',1)*24+TextBetween(FieldName,'Day','Hrs')&':'

&TextBetween(FieldName,'Hrs','Min')&':'&TextBetween(FieldName,'Min','Sec'), 'hh:mm:ss')

• ###### Re: Convert Time into minute

Hi Gaurav,

Try this example

Regards

Miguel del Valle