Convert :- Minutes to Days:Hours:Minutes
Hi Friends ,
I want to convert the time value from MINUTE to HH : MM : SS
I mean in input i have to pass 200 Minutes and in Output i want to get the no of hr and minutes in the format 03 : 20 ( HH:MM) . I have used the FM "CONVERSION_EXIT_SDURA_OUTPUT" for this .
This works fine for time input values upto 5 digits like ( 20000 minutes) = 333:20 (HH:MM) ,
when the input value is more than 5 digits , ex - 200000 this FM does not work .
Is there any FM where i can get the conversion from MINUTE to HH :MM:SS or from Minutes to DAYS :HPURS:MINUTES .
I have searched SDN , but i dint get the exact FM which i want ,
If any body has any idea on the same please guide me on the same .
Regards
Parbhudutta
Thanks all for all of your valuable inputs .
IBy using FM : MONI_TIME_CONVERT , i am able to get HH:MM:SS format data by giving input as seconds .
But the issues i have is , i have data as input in seconds which is noear to a 10 digit number like
200000000 seconds , which does not work for this FM .
I have input data in MINUTES which is near to 10 digit , exmp - 239879798 minutes . So i want to convert this no to ( DAYS : HOURS : MINUTES : SECONDS )
Other FMs that has been given by you guys i have checked but i am not able to get exactly what i want .
Anyway thanks again .
Reagards
Prabhudutta
Similar Messages
-
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 -
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 -
Convert days into days, hours and minutes
Hi,
In my report there is a column "# of Days (Submitted to Completed)" and the result I am getting is like 2.4, 3.5, 1.8 etc. Client requirement is to convert 2.4 days into days, hours and minutes (2 days 9 hours 36 minutes)
The value of "# of Days (Submitted to Completed)" is calculated during ETL.
Can you please tell me how to achieve this result.
ThanksCreate a formula where you could use the CAST function and calculate for the remainder by multiplying 24 for hours and 60 for minutes.
-
Showing a measure as days/hours/minutes
Hi gurus, I need you help quickly:)
I have a report that shows duration of time for certain actions. The only measure in the report is hours (with two decimals). I want the measure to be shown as e.g. 4 days, 4 hours, 30 minutes instead of 100,5 (hours). Is this possible. Sorry if the question is noobThank you very much! Works just as it should!:)
EDIT: Realized that my measure was MINUTES, not HOURS ...
But that´s good cause editing the formula provided by Sandeep forced me into really understanding it:)
If it helps anyone, here´s what you put in the column formula if you want number of MINUTES converted to days, hours, minutes:
cast(floor(column_name/1440) as char)||'days'||' '||cast(floor(mod(column_name,1440)/60) as char)||'hours'||' '||cast(mod(mod(column_name,1440),60) as char)||'minutes'
Edited by: SJV4-ever on 2011-mar-16 08:42 -
Date difference in Days,hours minutes and seconds.
Hi All,
I have two date Suppose one is getdate() and other one is gatedate() +1 .I have to show the difference, currently I used a datediff in the stored proc which just shows the difference of the days :( but i need to show the difference in days:hours:minutes:seconds if possible.
its a countdown with the current date. Like the two fields are sale_start_date and sale_end_date. Hope i am clear.
Please let me know ASAP thanks in advance.Can anyone help me?all help is great help.
Say the difference of
12/6/2007 7:00:00 AM, 12/8/2007 8:00:00 AM as 2 days 1:00:00)
Thanks
NOne of the problems of using DATEDIFF when dealing with either seconds or milliseconds is that this function will result in execution errors if the start and end dates span then entire domain of possible dates. Below is an alternative that seems to work over the entire date domain. A couple of things to note:
1. This select converts the days and seconds of each date into BIGINT datatypes to avoid the overflow error
2. This select uses a CROSS APPLY operator; in this case I chose CROSS APPLY to suggest the possibility of converting this select into an inline table function.
I suspect that if you dig around this forum and the net that you will find a better routine, but here is yet another alternative:
declare @test table
( startDate datetime, endDate datetime)
insert into @test values
('6/1/9', getdate()),
('6/9/9 15:15', '6/10/9 19:25:27.122'),
('6/9/9 15:15', '6/10/9 13:25:27.122'),
('6/9/9', '6/10/9 00:00:01'),
('1/1/1760', '12/31/2999')
select
startDate,
endDate,
[Days],
[Hours],
[Minutes],
[Seconds]
from @test
cross apply
( select
cast((endSecond - startSecond) / 86400 as integer) as [Days],
cast(((endSecond - startSecond) % 86400) / 3600 as tinyint) as [Hours],
cast(((endSecond - startSecond) % 3600) / 60 as tinyint) as [Minutes],
cast((endSecond - startSecond) % 60 as tinyint) as [Seconds]
from
( select
86400 * cast(convert(integer, convert(binary(4),
left(convert(binary(8), startDate),4))) as bigint)
+ cast(convert(integer, convert(binary(4),
right(convert(binary(8), startDate),4)))/300 as bigint)
as startSecond,
86400 * cast(convert(integer, convert(binary(4),
left(convert(binary(8), endDate),4))) as bigint)
+ cast(convert(integer, convert(binary(4),
right(convert(binary(8), endDate),4)))/300 as bigint)
as endSecond
) q
) p
/* -------- Sample Output: --------
startDate endDate Days Hours Minutes Seconds
2009-06-01 00:00:00.000 2009-06-22 08:28:36.670 21 8 28 36
2009-06-09 15:15:00.000 2009-06-10 19:25:27.123 1 4 10 27
2009-06-09 15:15:00.000 2009-06-10 13:25:27.123 0 22 10 27
2009-06-09 00:00:00.000 2009-06-10 00:00:01.000 1 0 0 1
1760-01-01 00:00:00.000 2999-12-31 00:00:00.000 452900 0 0 0
(5 row(s) affected)
EDIT:
I based the routine more-or-less on Thilla's reply.
Kent Waldrop -
I would like to download an application for my desktop and maybe even my iphone that will tell me how many days, hours, minutes, etc have elapsed since a particular date.
For example, my brother just had a baby and I want to put that date and time into the app and then determine how long it has been since that date and time.
Hopefully this makes sense, because I have not been able to locate anything.
Thanks in advance,This is fantastic. Thank you.
Is there any way to have something like this displayed on my desktop showing the time as it ticks away? -
How do I get a time value in days, hours and minutes returned to a cell from a calculation of distance divided by speed?
Simon,
you can use the duration function:
B4=DURATION(0,0,B1/B2)
you can further, format the cell as a duration like this using the cell inspector: -
Adding day/hour/minute/second to a date value
How does one add a day/hour/minute/second to a date value?
SQL> select to_char(sysdate, 'DD/MM/YYYY HH24:MI:SS') to_day,
2 to_char(sysdate+1, 'DD/MM/YYYY HH24:MI:SS') add_day,
3 to_char(sysdate + 1/24, 'DD/MM/YYYY HH24:MI:SS') add_hour,
4 to_char(sysdate + 1/(24*60), 'DD/MM/YYYY HH24:MI:SS') add_minute,
5 to_char(sysdate + 1/(24*60*60), 'DD/MM/YYYY HH24:MI:SS') add_second
6 from dual
7 /
TO_DAY ADD_DAY ADD_HOUR ADD_MINUTE ADD_SECOND
10/10/2006 11:54:23 11/10/2006 11:54:23 10/10/2006 12:54:23 10/10/2006 11:55:23 10/10/2006 11:54:24
SQL>Cheers
Sarma. -
How to convert decimal numbers to Hours and minutes
Hi,
I am using SSRS 2005. I want to convert decimal numbers to Hours and minutes.
Say suppose, I am adding daily work hours and minutes and the total is 208.63.
Here 208 hrs and 63 minutes. How to convert this to 209 hrs 03 minutes in SSRS.
Any In-built function is there? or how to do using custom code?
Appreciate your help.
Regards,
Balasuppose if field name is TotalDailyHours you can do it as below
=CStr(Cint(Floor(val(Fields!TotalDailyHours.Value)) + ((val(Fields!TotalDailyHours.Value)-Floor(val(Fields!TotalDailyHours.Value)))*100)/60)) + ":" +
Right("00" +Cstr(Cint(((val(Fields!TotalDailyHours.Value)-Floor(val(Fields!TotalDailyHours.Value)))*100) Mod 60)),2)
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
itune 11.0.0.163 shows silly date approximation on bottom bar rather than days, hours, minutes, seconds as before. How do I change this?
Apple buried the transfer purchases option, but it's still there. To transfer purchases from your iOS device in iTunes:
Select the device toward the top-middle of iTunes (underneath the status area/progress bar/Apple logo).
Go to the File menu.
Select Devices
Click on Transfer Purchases from [DeviceName]... -
Hi..
I have an issue in building the OBIEE repositoryin Administration tool.
I have a column of minutes (24hrs X 60 = 1440 mins in a day) as its values.
I need to build a column of Time ( convert minutes into time) using existing column of minutes.
Say 300 mins = 5:00AM (since -------> (60 X 5 =300))
315 mins = 5:15 AM
330mins = 5:30 AM
360mins = 6:00 AM.......so on in a day.
I appreciate your help.
Thank you.
Edited by: user11939829 on Aug 11, 2010 9:00 AMHi,
In Admin Tools, if you want to create a new colume as time(HH:MM), you can do it like this:
1. in "Business Model and Mapping", in the table which you want, create a logical column "Time"
2. Check the checkbox "Use exist logical column as the source"
3. In the expression builder, write the formula to convert minutes to time, like:
concat(concat(cast (minutes/60 as varchar(2)) , ':'), cast(mod(minutes,60) as varchar(2)))
Hope this helps you
Marc -
How to get two date difference in Day/hour/min/secs pl
First of all,
Hello to All, i am new to Oracle DB, but i have little experience in Other Database such as Sybase, sql server etc
please kindly help me
in DoctorChart table i have DocName,Id#,Citcotype,Medtype,AdmitDate,DischargeDate(both admitdate & Discharge date is date formatted columns)
so how can i get the below differenceTime (which means Dischargedate-Admit Date in below format i.e, Day,Hours,Minutes,Seconds...)
DoctorName, ID #, Citco type, MEDtype, DifferenceTime
========= === ======= ======= ===========
Dr. KindaEmesko, 20045, Replace OutCard, ICH, 0 day 9 hours 11 minutes
Dr. KindaEmesko, 20098, Replace OutCard, ICH, 1 day 2 hours 34 minutes
Dr. KindaEmesko, 20678, Replace OutCard, ICH, 2 day 23 hours 52 minutes
Dr. KindaEmesko, 20212, Replace OutCard, ICH, 4 day 1 hours 00 minutes
Dr. KindaEmesko, 20345, Replace OutCard, BED, 3 days 14 hours 15 minutes
Dr. KindaEmesko, 20678, Replace OutCard, BED, 9 days 21 hours 52 minutes
Dr. KindaEmesko, 20015, Signature Overlay, Rest, 0 days 3 hours 29 minutes
Dr. KindaEmesko, 45678, Signature Overlay, Rest, 0 days 1 hours 29 minutes
Same way how can i get the Average Time for the above result (without ID columns)
DoctorName, Citco type, MEDtype, Avg DifferenceTime
========= === ======= ======= ===========
Dr. KindaEmesko, Replace OutCard, ICH, 2 day 1 hours 00 minutes
Dr. KindaEmesko, Replace OutCard, BED, 6 days 17 hours 15 minutes
Dr. KindaEmesko, Signature Overlay, Rest, 0 days 2 hours 29 minutes
Please just tell me how to get the two dates difference as day/hour/minute format
as well as how to get avg ( two dates difference as day/hour/minute format)
Please Help me
Thanks in advanceWell, instead of all these suggested manipulations you can simply use intervals. Oracle uses day as a unit in date arithmetic, so Dischargedate-Admit Date is number od days between two dates. Built-in function numtodsinterval can be used to convert it into interval. For example:
SQL> with t as (
2 select trunc(sysdate) - 2 Admit_Date,
3 sysdate Discharge_Date
4 from dual
5 )
6 select numtodsinterval(Discharge_Date - Admit_Date,'DAY') Hospital_Stay
7 from t
8 /
HOSPITAL_STAY
+000000002 00:01:08.000000000
SQL> SY. -
How to show number of days:hours:min:second
Hi !
Need your help on this one:
I have to calculate the number of ( Days;Hours:Minute:Second ) that a ticket have been opened
But I have a problem to display the format that I want: DD:HH:MM:SS
EX:the ticket have been opened 2011-05-03 11:00:00
first I create a formula to show number of second to show how long the ticket have been opened since the currentDate in seconds
Formula Name is:
{@number of seconds OpeningTime}
Crystal Syntax:
DateTimeVar dt1:= {@DTOpenDate};
DateTimeVar dt2:= {@CurrentDateTime};
If dt2 >= dt1 Then
NumberVar ds:= (Date(dt2) - Date(dt1))*86400;
NumberVar hs:= (Hour(dt2) - Hour(dt1))*3600;
NumberVar ms:= (Minute(dt2) - Minute(dt1))*60;
Numbervar ss:= Second(dt2) - Second(dt1);
NumberVar ts:= dshsms+ss)
Else
NumberVar ds:= (Date(dt2) - Date(dt1))*86400;
NumberVar hs:= (Hour(dt2) - Hour(dt1))*3600;
NumberVar ms:= (minute(dt2) - Minute(dt1))*60;
NumberVar ss:= Second(dt2) - Second(dt1);
NumberVar ts:= dshsms+ss)
then I create another formula to display the format that I want:Ex:if the ticket have been opened for about 25hh:00mm:00ss
i want to show 01:01:00:00
DD:HH:MM:SS
Formula name: {@DTConversionOpeningTime}
I use Crystal Syntax:
WhilePrintingRecords;
StringVar Days1;
StringVar Hours1;
StringVar Minutes1;
StringVar Seconds1;
NumberVar Duration:=0;
Duration:= {@number of seconds OpeningTime};
If Duration < 0 Then
"Cannot have a time less than zero"
Else
(Days1:=ToText(Truncate(Duration/86400),0);
Hours1:=ToText(Truncate(Duration/3600),0);
Minutes1:=ToText(Truncate(Remainder(Duration,3600)/60),0);
Seconds1:=ToText(Remainder(Remainder(Duration,3600),60),0));
//Display format
(if length(Hours1) < 2 then '0')+ Days1 + ":" +
["0",""][length(Hours1)]+ Hours1 + ":" +
["0",""][length(Minutes1)] + Minutes1 + ":" +
["0",""][length(Seconds1)] + Seconds1;
Thanks for your helpFind a solution, see thread:
Re: Converting a calculated field into format of dd:hh:mm:ss answered by Jason Long -
To display Days Hours Mins Format based on business hours
Hi,
I want to display Days Hours Mins Format.
I am Having two columns Like below,
Col1 (in days) col2 (In Hours : Mins)
3days 4:5
In this first have to add Col1 and Col2 (Here one day is equals to
9 hours ) so the addition is 31.5
from this 31.5 i should display 3 Days 4 Hours 30 Mins because 31.5 contains 3 (9 hours) days 4 Hours and .5 is equals to 30 mins.
Kindly please help me in this,
thanks in advance.
GVRSPK VENIHello gvespk,
Regarding your description, are you looking for some sample as below?
DECLARE @T TABLE
ID VARCHAR(99),
SubID INT,
Days INT,
Hours FLOAT
INSERT INTO @T VALUES
('abz', 1, 2, null)
,('abz', 2, null, 3 )
,('abz', 3, 3, 4 )
,('abz', 4, null, null )
,('abz', 5, 2, null )
,('abz', 6, 1, 5 )
,('abz', 7, null, 2 )
,('abz', 8, null, null )
,('abz', 9, 2, 3 )
,('abz', 10, null, 2.5 );
SELECT SUM(DAYS)+FLOOR(SUM(HOURS)/9) DAYS
, FLOOR(SUM(HOURS)-FLOOR(SUM(HOURS)/9)*9) AS HOURS
, (SUM(HOURS)-FLOOR(SUM(HOURS)))*60 MINUTES FROM @T
DAYS HOURS MINUTES
12 1 30
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support
Maybe you are looking for
-
External hard drive error / disk utility not repairing
I am having problems with a particular external hard drive. Device is a Transcend StoreJet 25M (640GB) currently formatted in Mac OS Extended (Journaled). It was previously formatted in FAT32, exFat, and also Mac OS Extended (Journaled). It started g
-
How to change the Size of a Column in TimesTen
I have a Column of type VARSHAR2(32). I would like to increase the size to 255; Is the only to do this is to drop the table and add it again?
-
I have run the automatic updater and it failed with following messages Adobe Photoshop 13.0.3 Voltooid met fouten. Foutcode: U44M1P6 Adobe Bridge CS6 5.0.1-update Installatie is mislukt. Foutcode: U44M1P7 Photoshop Camera Raw 7.3-update Installatie i
-
Which card should I buy if I like customizable EAX/DSP listening effects?
Hello all, I'll first tell you, what audio system I currently use&know, then what I am looking for... and about the mispurchase I have unfortunately already made. My current main audio system: SoundBlaster X-Fi Titanium PCI-E on Win7 x64 Samsung HW-C
-
FRM-92101-Did any one migrate to 10GR2 from Forms 6 generated by Designer 6
I am using designer 6 PLLs . We are migrating to 10GR2; Recompiled all plls in 10GR2 and it is throughing FRM92101 for all Tabbed forms. Upon debugging it is breaking at the OFGTAB.pll. Any help is appreciated! Thanks.