How to convert time to minutes?

Ask general questions here.
reutH
Posts: 3
Joined: Mon May 15, 2017 7:38 am

How to convert time to minutes?

Post by reutH » Sun Aug 06, 2017 1:58 pm

Hi,
What is the best way to calculate from string like: "13:19:56" (13 is hours, 19 is minutes and 56 is seconds) the total minutes? (13*60 1+19)

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3914
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to convert time to minutes?

Post by odklizec » Mon Aug 07, 2017 7:43 am

Hi,

You can for example use code like this:

Code: Select all

	string time = "13:19:56";
	double minutes = TimeSpan.Parse(time).TotalMinutes;
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration