|
How to convert the time 11:21:21 into total minutes?
Started by Jibu P C on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Value using the TimeOfDay method, then use the TotalMinutes method to get the time in minutes:
DateTime t = new DateTime(0, 0, 0, 11, 21, 21); double minutes = t.TimeOfDay.TotalMinutes;
The minutes variable now contains 681.35 .
|
|
In sybase is there any built in functions to convert a seconds value into hours, minutes, and seconds?
Started by bobwah on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I don't know if there is such a function, but if there isn't, the simple formulae are:
HH = floor(seconds / 3600) MM = floor(seconds / 60) % 60 SS = seconds % 60
If it's value limited by 1 day, you can use this:
datepart(hour, dateadd(second, value, ... .
|
|
Overall goal: User enters some number in minutes and I change those numbers from minutes to some usable form in a calculation.
How do I convert the user input in the form of minutes to some number or value that I can use later on in this php script?
&...
Started by Newb on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Minutes are....
Seconds to do any computation ? When you are done you can convert again from seconds to minuteswhy don't you just convert everything in seconds and use the number of seconds and the cost per and display your results.
|
Ask your Facebook Friends
|
I have some number of miles and a speed in MPH that I have converted into the number of hours it takes to travel that distance at that speed. Now I need to convert this decimal number into hours, minutes, and seconds. How do I do this? My best guess right...
Started by Jared on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Time = distance / speed; int hours = time; double minutesRemainder = (time - hours) * 60; int minutes = minutesRemainder; double secondsRemainder = (minutesRemainder - minutes) * 60; int seconds as I haven't tested it, but I would first....
|
|
Hi,
I've got an amount of seconds that passed from a certain event. It's stored in a NSTimeInterval data type.
I want to convert it into minutes and seconds.
For example I have: "326.4" seconds and I want to convert it into the following string: "5:26...
Started by Ilya on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If you want Cocoa API do it for you and convert your NSTimeIntervalpseudo-code:
minutes = floor(326.4/60) seconds = round(326.4 - minutes * 60)
Since part will be the whole number of....
Only want to convert to minutes.
|
|
Hi, i want a php function to convert a unix time stamp to like this:
15 seconds
or
45 minutes
or
3 hours
and not like this : 2seconds, 5minutes, 9 hours
i want only one value like digg ( made popular xx )
Thanks
Started by Tom on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
This function will get the difference in days, hours, minutes, or seconds and return in the format 'X days/hours/minutes/seconds':
<?php function GetTimeDiff($timestamp) { $how_log_ago = ''; $seconds = time() - $timestamp; $minutes....
|
|
The Twitter API returns time stamps of the form:
"Sat, 25 Jul 2009 04:54:42 +0000"
What's the best way to convert a time stamp of this form to " ____ seconds/minutes/hours/months ago" depending on the time zone?
Thanks
Started by inktri on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Javascript Pretty Date by John Resig
See this question http://stackoverflow.com/questions/11/how-do-i-calculate-relative-time
I do this on my site often but I use PHP not javascript for the conversion .
|
|
Id like to be able to convert the following XML
<itunes:duration>00:09:54</itunes:duration>
To a total of minutes, I currently just output the complete value but I would like to just display: 0hr 9min 54sec
Or possibly round up to the nearest...
Started by danit on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You probably want something like: minutes processor dows support XPath 2.0
If you just want to round up you can substring minutes and seconds, and if seconds > 30 -> minutes....
A list , scroll down to the date/time functions.
|
|
Hi!!
How can I convert an int 90, for example, to DateTime 1:30 in C# 3.0?
Thanks!!
Answer Snippets (Read the full thread at stackoverflow):
And in such a case, you'd use this:
TimeSpan ts = TimeSpan.FromMinutes(90);
If you insist that you need a DateTime, you could do the following:
DateTime dt = DateTime.Now... .
You shouldn't use a DateTime to represent a span of time - use TimeSpan for that .
|
|
Whats an easy way to convert 00:20:40.28 to seconds with a bash script? (Split seconds can be cut out, it’s not essential.)
Started by Mint on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Mytime=’00:20:40.28′ part1=${mytime%%:*}; rest.
By the appropriate amounts for hours and minutes.
|