Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Convert the time into minutes

Hi,

- I have a field with date and time( e.g 04-24-2011 1:24:56 ).

- Now i want to convert only time into minutes.

Is it possible to do this?

I want to do this b'coz. I need last 10 or 20 0r 30 mins in my report.

- Once i can able to convert the time into minutes. It is easy to reduce the minutes based on my selection of number of mins i need.

5 Replies
Not applicable

Ho Boppy,

simply cut the time from the whole value by using right() method. your time having 7 characters including :

let Totalminutes= subfield(right(FieldName,7),':',1) * 60 + subfield(right(FieldName,7),':',2) + subfield(right(FieldName,7),':',3) / 60

now your Totalminutes variable holding the total minutes..

Anonymous
Not applicable

Another approach to get the total amount of minutes would be:

=interval(frac(timestamp#('04-24-2011 11:24:56', 'MM-DD-YYYY h:mm:ss')),'mm')

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Thanks for your response johannes sunden. But when i taken the field of particular date it is not working.

e.g:

=interval(frac(timestamp#('03-01-2011 1:24:14', 'MM-DD-YYYY h:mm:ss')),'mm')

replaced like this

=interval(frac(timestamp#(maxCarrdatetime, 'MM-DD-YYYY h:mm:ss')),'mm')

- I'm trying this to display in text box.

What is the problem? How can i overcome this? Plz help me

Not applicable

You can try using

Interval(StartTime - EndTime) and then formatting this as interval on the number Tab, if you use the format mm , you would get the time difference in minutes

Clever_Anjos
Employee
Employee

try

round(frac(yourfield),1/*(24/60))