Converting seconds to HH:MM:SS
Apologies if this has been answered already, but I'm simply trying to convert seconds to HH:MM:SS. If someone could point me to how Numbers can best handle that I'd appreciate it.
Here's an example: The CSV I receive has a duration column that has the number 3718 in it, representing the total number of seconds. What I wish to see is it broken out to read 01:01:58.
Thanks in advance.
Hello
I'm not sure that I understand well your question.
Numbers is right: B2:B4 is not a number, it's a range of cells.
Your formula is trying to use this range of cells as a number representing the minutes: it's meaningless. The number of minutes may be given two ways
B2B3B4
This way the formula would be =TIME(0,B2B3B4,0)
an alternate way (more efficient) is
SUM(B2:B4) (which means sum of the contents of every cell from B2 thru B4
This way the formula would be =TIME(0,SUM(B2:B4),0)
If you looked at the Help you would have read:
TIME
The TIME function converts hours, minutes, and seconds into a time format.
TIME(hours, minutes, seconds)
hours: The number of hours (using a 24-hour clock).
minutes: The number of minutes.
seconds: The number of seconds.
Notes
You can specify hour, minute, and second values greater than 23, 59, and 59, respectively. If the hours, minutes, and seconds add up to more than 24 hours, Numbers subtracts 24 hours repeatedly until the sum is less than 24 hours.
If you don't wish to see the seconds appearing in the cell, apply the format Time > hh:mm
I agree with most users about the need for enhancements about the time treatment, mainly the addition of a "Duration" format not limited to the range 0 thru 23:59:59.
BUT for the questions asked in this thread no enhancements are required.
The available tolls fit perfectly the needs … but of course, users must read the given explanations
I'm always surprised to see guys paying to learn to use a bicycle and many other tools but reluctant to learn how to use softwares they are employing daily.
I never accepted the well known acronym: RTFM (Read The Fu…g Manual).
In fact I never read a manual, but I consult them when I need an info.
I always thought that forums are here to respond to questions whose responce is not in the manuals (and they are sufficiantly numerous).
Of course, it is often more time consuming to explain this advice than reproducing some lines from the manual but I think that no one may seriously use a tool begging the info for every task.
We are assumed to be thinking beeings. Aren't we ?
Of course the given formulas assumes that the time value is fitting the Numbers's requirements (from 0 thru 23:59:59)
Yvan KOENIG (from FRANCE jeudi 3 janvier 2008 13:38:55)
Similar Messages
-
Convert seconds to [h]:mm:ss format on report text box
I want to convert seconds to hh:mm:ss format on the report text box.
I use =Format(Sum([MyTime])/(24*60*60),"hh:nn:ss"), but it does not work if the hours more than 24 hours, since the format is for the time format for the day.
I need the result shows more than 24 hours, because I want to show how many hours and minutes from my seconds value.
I can use [h]:mm:ss for Excel that it gives me the total hours more than 24 hours.
I tried to use the following to my text box
Int((sum(MyTime)) / 3600) & Format(Int((sum(MyTime) / 60) Mod 60, "\:00") & Format(sum(MyTime) Mod 60, "\:00"),
but for some reason it only shows seconds part without minute and hour part of the value.
Your help and information is great appreciated,
Regards,
Souris,I want to convert seconds to hh:mm:ss format on the report text box.
I use =Format(Sum([MyTime])/(24*60*60),"hh:nn:ss"), but it does not work if the hours more than 24 hours, since the format is for the time format for the day.
I need the result shows more than 24 hours, because I want to show how many hours and minutes from my seconds value.
Hi sourises,
You can use the next function. Place it in a general module.
Function Sec_to_str(seconds)
Dim uur As Integer
Dim min As Integer
Dim sec As Integer
Dim cur_sec As Variant
cur_sec = seconds
If (IsNull(cur_sec)) Then
Sec_to_str = Null
Else
sec = cur_sec Mod 60
cur_sec = cur_sec \ 60
min = cur_sec Mod 60
cur_sec = cur_sec \ 60
uur = cur_sec
If (uur = 0) Then
Sec_to_str = Format(min, "#0") & ":" & Format(sec, "00")
Else
Sec_to_str = Format(uur, "#0") & ":" & Format(min, "00") & ":" & Format(sec, "00")
End If
End If
End Function
Imb. -
Converting seconds to hh:mm:ss format?
Hi, can anyone help me with a formula in Webi XIR2 to convert seconds to hh:mm:ss in the result cell on the report level? Now we have results in the cells in seconds and should have this format: 00:04:12 for 0h 4min et 12 s.
Thanks in advance.
Laurent PeterHi,
If you want to do this at the report level then try the following.
Create a new Variable and define it as:
=FormatNumber(Floor(<Column_Name>/3600) ,"00") & ":" & FormatNumber(Floor(Mod(<Column_Name> ,3600)/60) ,"00") & ":" & FormatNumber(Mod(Mod(<Column_Name> ,3600) ,60) ,"00")
In the above formula Column_Name is the attribute that displays the seconds.
- Noman Jaffery -
Convert seconds to Days, hours, Minutes, Seconds in Reporting Services
Hi Guys,
Im currently reporting of an analysis services cube, however I have value which is in seconds and would like to report on this in reporting services as day:HH:MM:SS.
Has anyone got any experience reporting in this format?
Regards
DaveHi Dave,
We can use custom code to convert seconds to HH:MM:SS
Public Function Calculate(ByVal TotalSeconds as Integer) as String
Dim Hours, Minutes, Seconds As Integer
Dim Hour, Minute, Second As String
Hours = floor(TotalSeconds/ 3600)
IF Hours<10
Hour="0" & Hours.ToString
Else
Hour=Hours.ToString
End IF
Seconds = TotalSeconds Mod 3600
Minutes =floor( Seconds / 60)
IF Minutes<10
Minute="0" & Minutes.ToString
Else
Minute=Minutes.ToString
End IF
Seconds = Seconds Mod 60
IF Seconds<10
Second="0" & Seconds.ToString
Else
Second=Seconds.ToString
End IF
Return Hour & ":" & Minute & ":" & Second
End Function
Then we can use the expression to conver it.
=Code.Calculate(Fields!Column.Value)
The report looks like below:
If you have any questions, please feel free to ask.
Regards,
Charlie Liao
If you have any feedback on our support, please click
here.
Charlie Liao
TechNet Community Support -
Converting seconds to hours + minutes + seconds
hey all,
was just looking for the quickest way to convert seconds to hours + minutes + seconds
eg, 18084 s is 5h, 1m, 24s.You can use the Apache Commons Lang DurationFormatUtils class
import org.apache.commons.lang.time.*;
public class SecondsConversion {
public static void main(String[] args) {
try {
int seconds = 18084;
int milliseconds = seconds * 1000;
String[] values = DurationFormatUtils.formatDuration(milliseconds, "H m s").split(" ");
System.out.println(values[0] + "h " + values[1] + "m " + values[2] + "s ");
} catch (Exception e) {
e.printStackTrace();
} -
Converting seconds to minutes format
Post Author: mwatson
CA Forum: WebIntelligence Reporting
How do you convert seconds to minutes in mm:ss format?Post Author: SKodidine
CA Forum: WebIntelligence Reporting
totext(truncate(/60),0,'','') & ":" & totext(remainder(,60),0,'','') -
I was working on this query but I was wondering if there was a way to convert seconds to a date. The program records the number of seconds since January 1, 1960.
SELECT (CLINICALDATE/1000000) "DATE" FROM DOCUMENT WHERE ROWNUM < 6
DATE
1389799659
1406552001
1406553986
1406553986
1406555279
5 rows selectedmay be this,
1 with t as
2 (select 1389799659 CLINICALDATE from dual
3 union all
4 select 1406552001 from dual
5 union all
6 select 1406553986 from dual)
7 select (CLINICALDATE)/60/60/24 as days, to_date('01-01-1960','dd-mm-yyyy')old_day,
8 to_date('01-01-1960','dd-mm-yyyy')+ ((CLINICALDATE)/60/60/24) New_day
9* from t
SQL> /
DAYS OLD_DAY NEW_DAY
16085.6442 01-01-1960 00:00:00 15-01-2004 15:27:39
16279.537 01-01-1960 00:00:00 27-07-2004 12:53:21
16279.56 01-01-1960 00:00:00 27-07-2004 13:26:26typo
Message was edited by:
devmiral -
Hi
I would like to convert seconds to hours -
I have tried the below two -
select to_char(to_date(176400,'SSSSS'),'HH:MI:SS') from dual;
SELECT NUMTODSINTERVAL (176400, 'minute') FROM DUAL;
RegardsHi,
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
Simplify the problem as much as possible. Remove all tables and columns that play no role in this problem.
Always say which version of Oracle you're using.
If you have a number of seconds (s), you can find the equivalent number of hours (h) if you divide s by the number of seconds in an hour, 60 * 60 = 3600.
SELECT s
, s / 3600 AS h
FROM table_x
;H won't necessarily be an integer. If you want an integer, use a rounding function: ROUND, TRUNC, FLOOR or CEIL -
Converting seconds to a date in another language
Hello all,
I am currently working on an application that uses web services to populate a web-based UI. One of the outputs is a measurement time that is generated using the LabVIEW method 'Get Date/Time in Seconds'. To make since of this, I convert the value to a double precision float and transmit it to the host (on request). On the host side, I am using Javascript to populate a text box with the current measurement date and time. To do this, I use the followign code
var dateobj = new Date(1904,1,1);
/* The variable 'time' should be the seconds since
* midnight 1 Jan 1904 of the current measurement.
var measTime = dateobj.setSeconds(time);
When I do this, what I find is that the time is actually one month off. I can correct this by changing the date in the creation of my 'dateobj' to 1 Dec 1903. Has anyone seen this before, possibly in another language? It is not beyond the realm of reason that I am doing something incorrectly, but I can't seem to get at what right now.
Thanks, Matt
Matt Richardson
Certified LabVIEW Developer
MSR Consulting, LLC
Solved!
Go to Solution.mtat76 wrote:
Hmmmm...that's intriguing.... I need to do some more thorough experimenting to see if I can reproduce this behavior and if there is some point at which it all flips and problem goes away. I am pretty sure that like Teststand, time is referenced to 1970 rather than 1904. I will look into this and try to provide some more details. I was hoping that someone would pop up and say that they had done this before and had no problems; but, I may be a bit optimistic...
Epoch for LabVIEW IS the non-existant second before midnight on Jan 1 1904, Leap secods are un-accounted for to the best of my knowlegde. and since 1904 WAS a leap year the Lotus" phantom 1900 Feb 29 does not pertain at all.
The "one month off issue" bares investigation. I Know Altenbach reported that happened with NI Error Reporting Service logs but, my Google skills fail me and I never did read a "First cause" analisys of the resolution. (The CAR is closed: Read that as "Maybe someone at NI found a viable workaround")
Jeff -
Converting seconds to HH:MM:SS - How can I do that?
I have a need to convert raw seconds (up into the thousands of seconds in many cases) into a formatted field of:
HH:MM:SS
Additionally, this field is ultimately a SUM field, so will be summing for the seconds in the report detail (which is invisible). Can someone please point me to the function that will do that for me?
Thanks so much! (Crystal XI)
Dennis
Edited by: DJOlson on Apr 20, 2009 9:20 PMtotext(abs({database.field} / 3600),"00") & ":" &
totext(abs(remainder({database.field},3600) / 60),"00") & ":" &
totext(abs(remainder(remainder({database.field},3600),60)),"00");
If you will be summing the seconds, then create another formula with the above statements to the total to give you HH:MM:SS
Edited by: Sanjay Kodidine on Apr 20, 2009 11:40 AM -
Converting seconds to Days,Hours,mins and secs
Hi gurus,
I have a metric in seconds , which is a box uptime . I want to convert that into Days,hours , mins and secs .How can I do that ?
For example , If I have 433500 secs , I should show it as 5days 00:25:00 or in some meaningful format . Can anyone help me out ?
Thanks,Hi,
Refer thinks,
Re: seconds to hh:mm:ss format
OBIEE 11g - Change seconds to DD HH:MM:SS format
Deva -
days/hours/minutes/seconds.
Does anyone know how to convert a # that equals total seconds to days/hours/minutes/seconds??
Thanks as always
Adami guess you can mod the number with 360 first and get the number of days, then get the remainder and mode by 60 get the hour and so forth, maybe a better way is using recursive function to return you a final result. Hopefully this will help, don't complain on me if I am misleading you since this is my first time try to help.
-
Converting seconds to hrs, and minute
I have never used function, is there a way to convert without using the declare...
Hi,
I have three columns, hour(s), min(s), sec(s)
I can add it up, but will like to convert it into. hrs, mins and sec.
this is how, i am adding it up into seconds.
SELECT ((TotalTimeSpentHrs*60*60)+(TotalTimeSpentMin*60)+(TotalTimeSpentSec))AS totaltime
FROM EST1
how can I convert it. thanksuse a function like this
CREATE FUNCTION GetTimeParts
@Seconds int
RETURNS TABLE
AS
RETURN
SELECT @Seconds/3600 AS HourPart,
(@Seconds%3600)/60 AS MinutePart,
(@Seconds%60) AS SecondPart
GO
Then we can invoke it like
SELECT * FROM dbo.GetTimeParts(144072)
which means 144072 seconds equivalent to
HourPart MinutePart SecondPart
40 1 12
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
i get it , what of if i want to populate a column in a table with the result, what variable will a pass into
SELECT * FROM dbo.GetTimeParts(xxxxxxx)say the column name is timespent
What you asked for was 3 columns in output. How do you store it in a single column?
Or do you mean you want single value as xx hours yy minutes zz seconds?
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
yes i mean, mean you want single value as xx hours yy minutes zz seconds? -
Convert seconds to minutes 121 (seconds) to 2:01.
I receive a variable only in seconds. I'm trying to convert
it to minutes when greater than 60.
i.e. 121 (seconds) to 2:01.
Can anyone help with the code. I got this far:quote:
Originally posted by:
Kronin555
<cfset minutes = duration / 60>
<cfset seconds = duration mod 60>
<cfoutput>#minutes#:#numberformat(seconds,'00')#</cfoutput>
Thanks so much! I was confused at first because the numbers
coming up with many decimal points making their accuracy pretty
much unreadable to me so I changed to:
int(minutes)#:#numberformat(seconds,'00')# -
Convert Seconds to Hours:Minutes:Seconds
If I have an integer holding the number of seconds, how can I convert it into a string/relavant format in the form Hours:Minuteseconds?
For example, 123 seconds should be 00:02:03.
If it is possible to do the above, then how can I seperate it into 00 Hours indicator, 02 Minutes indicator and 03 Seconds indicator?Here are some alternative solutions, there are many more. (VI is LabVIEW 8.2)
LabVIEW Champion . Do more with less code and in less time .
Attachments:
GetTimeElements.png 31 KB
GetTimeElements.vi 11 KB
Maybe you are looking for
-
in order to open FF a second time i need to manually close the process. i have disabled all plugings
-
Populating Datagrid using MySQL
Hi everyone, I need help bad. I am trying to populate my datagrid and i am using mysql. My table "Enhancement" consists of (enhancement_id, descr, details, version_reported, version_completed, date_reported, date_completed, reported_by, completed_by,
-
Error in sevice() method
hi! i am using service method in servlet its like public void service(HttpServletRequest req,HttpServletResponse res)throws IOException on compiling servlet i get following error >java GiftServlet java.lang.NoClassDefFoundError: GiftServlet Exception
-
Itunes 7.7 IPod Touch 2.0 - Will not sync calendars with Outlook 2003
All was fine until I upgraded both my Itunes to 7.7 and the IPod Touch firmware to 2.0. My Outlook Calendars and Contacts sync'ed perfect back and forth between Outlook on my XP machine and my Touch. Now calendars will not synch. I've spent a day sea
-
My yosemite mac crashes when I open iphoto
Hello, My problem is that as soon as I open iPhoto I can se my iphoto app for 2 seconds and then either the screen goes black or the screen splits in two and all the pixels go out of place and I have to restart it because it turns into a brick. I was