"number" to "hours" format

Hello experts,
i wonder is there any way to make a calculation for converting number (ex. 6,68) to HH:MI:SS format (6":"0,68*60":"00). I gave up with TRUNC or MOD.
Thanks

Hi,
If tnum is the number of hours, so 1.5 is 1hour 30mins then you can use:
TO_CHAR(TRUNC(ROUND(TO_NUMBER(tnum) * 3600)/3600), 'fmTM9')
||':'||TO_CHAR(ABS(MOD(TRUNC(ROUND(TO_NUMBER(tnum) * 3600)/60),60)),'fm00')
||':'||TO_CHAR(ABS(MOD(ROUND(TO_NUMBER(tnum) * 3600),60)),'fm00') Rod West

Similar Messages

  • How can I change my iCal times to be listed in 12 hour format?

    I have the system set for 12 hour but it does not seem to carry over to iCal.  I have restarted since changing the system to 12-hour clock.
    By the way, I mean the little timeline running down the left hand side in week view.  Individual appointments are opening in 12-hour format.
    I've worked on this a bit and now noticed that the event times are listed as 5:30PM-18 etc.  Any hour which is 'on the hour' is a single number from a 24 hour clock!  Wierd. 
    Don't want to change away from UK settings because then I'll have to mess with date formats and everything.  There must be a way to edit the date, although doing it through 'Language & Text' doesn't seem to be having the desired effect!
    Thanks
    JP

    This isn't Lion-specific. I had the same prob changing OS a couple of years ago and now again changing to Lion on a new laptop.
    Changing the Date and Time settings would do it (you'd think) but it doesn't. It was always embedded in International (now Language &Text). It seems to be a bug though as I've Custom Edited selecting 12-hr clock with am/pm and have the same issue. On-the-hour has no am/pm or zeros.
    I've learnt not to waste too much energy on it once it doesn't make logical sense as it's generally a bug.
    I'm loving Lion though - even unexpectedly using the natural scrolling.....but I digress....

  • How to configure JSpinner to accept number of hours (with mins and secs)

    I'm having a problem trying to figure out a simple way to enable a JSpinner to do allow the input in this format:
    n hours : n minutes : n seconds
    ex: 100 : 0 : 0, 1:59:59, 25:30:00
    Where n hours could be from 0-n (not restricted by 24 hours) and minutes and seconds are, of course, < 60. That is, I can enter number of hours, not a date, or a specific time in a day.
    I'm thinking the only way to do this is with a custom spinner model and custom editor? Or is there a simple way I can make the date model in spinner to allow me to do this?
    Thanks

    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Test2 extends JFrame {
      public Test2() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        content.setLayout(new FlowLayout());
        content.add(new MySpinner());
        setSize(300, 300);
        setVisible(true);
      public static void main(String args[]) { new Test2(); }
    class MySpinner extends JSpinner {
      public MySpinner() {
        setModel(new SpinnerDateModel(
          new GregorianCalendar(2004,0,1,0,0,0).getTime(),
          null, null, Calendar.DAY_OF_YEAR));
        setEditor(new DateEditor(this,"HH:mm:ss"));
    }???

  • Calculate number of hours per week and limit

    Hi,
    I have a list in SharePoint that manages over time.
    I need to set a limit for a user for 15 weekly hours that he can ask for OT.
    Is there a way to limit once the user passes the limit above? 
    Thanks a lot in advance

    Sum the total number of hours person worked on.
    Create a calculated column and
    http://msdn.microsoft.com/en-us/library/office/bb862071%28v=office.14%29.aspx
    Calculate the difference between two times
    To present the result in the standard time format (hours:minutes:seconds), use the subtraction operator (-) and the TEXT function. For this method to work, hours must not exceed 24, and minutes and seconds must not
    exceed 60.
    Column1
    Column2
    Formula
    Description (possible result)
    06/09/2007 10:35 AM
    06/09/2007 3:30 PM
    =TEXT([Column2]-[Column1],"h")
    Hours between two times (4)
    06/09/2007 10:35 AM
    06/09/2007 3:30 PM
    =TEXT([Column2]-[Column1],"h:mm")
    Hours and minutes between two times (4:55)
    06/09/2007 10:35 AM
    06/09/2007 3:30 PM
    =TEXT([Column2]-[Column1],"h:mm:ss")
    Hours, minutes, and seconds between two times (4:55:00) 
    If this helped you resolve your issue, please mark it Answered

  • How do I list the last n number of hours with respect to sysdate?

    I had a query regarding listing the last n number of hours with respect to sysdate?
    Say the current time is 1 AM, I want to get an output in the below format:
    1 AM
    12 AM
    11 PM
    10 PM
    9 PM...
    I know I can do it using a simple begin end block but I want the output to be returned in one single query.
    Any help would be very appreciated..

    Thanks!!
    I just figured it out as well!
    I used this:
    with hour_list as
         select trunc(sysdate- level/24,'HH') ,rownum
         from dual
         connect by level <=8
    select * from hour_list;

  • Change GMT time and 12 hours format in the Callback Properties dialog box

    Hello! There are CAD 7.6.3 for UCCE. In the Callback Properties dialog box for personal CallBack displays the Customer's Current Time in GMT 0 and the data format of 12 hours.
    How to display in this window, the time is GMT +3 and change time in 24-hours format?

    Hi,
    Please check your local time format settings by the following steps:
    1. Click the Time in the right bottom corner taskbar.
    2. Click Change date and time settings.
    3. In Date and Time window, click Change data and time.
    4. In Date and Time Settings window, click Change calendar settings.
    5. In Customize Format window, switch to Time tab.
    6. Change the Short time format as H:mm instead of h:mm tt, set the Long time as H:mm:ss.
    7. Click OK to save the setting to have a try.
    Regards,
    Winnie Liang
    TechNet Community Support

  • How do I change to 24 hour format in iCal?

    I have an iMac Maverick 10.9.1  Currently iCal is set up with the AM/PM format.  How do I change it the 24 hour format(i.e. 1800 = 6pm)?

    arneomi93,
    Quit Calendar, open System Preferences...>Language & Regions>Regions: and set/-re-set the appropriate Region. Also, make sure the "Time format:" in that preference pane is checked for 24-Hour Time.

  • FM to find the difference in the number of hours

    hi all,
    is there any function module to find out the difference between two time stamps on two different dates. say if an activity starts on 09/05/2007 at 11:23:24 and ends on 09/08/2008 at 14:24:26. it needs to find the number of hours between the two. for this case it should be:
    75:01:02 hours:mins:secs.
    or a FM which works in a way similar to the above functionality.

    Hi,
    Use FM SD_CALC_DURATION_FROM_DATETIME
    but this will not give the seconds difference
    Regards
    Shiva

  • How do I change the new iTunes play list total time display from 1.5 hours format to exact display of 1hr 31min 12sec.

    In the new iTunes the play list total time displays in 1.5 hours format, how do I get it to clearly show 1hr 31min 12sec like before, I want the exact time so I can properly fit all the songs when I want to burn this playlist to a disc. You can no longer just click on it to change the display format. Nor can you right click, control click, or change it in options. If anyone knows I would very much appreciate your imput. Thank You.

    Actually, that's the problem ... in iTunes *11* it has stopped working.  I have the status bar displayed, and it is stuck on the 1.x hours format.
    That is very, very strange !!
    I can't get that to happen on mine. It worked in 11.0 and I updated today to 11.0.1 and it's OK.
    I've tried making a new playlist, I've tried changing an old playlist, smart playlist ...... all OK ????

  • Hi im having difficulty with my iphone 4s its been on charge for a number of hours and continues to flash the apple logo but will not turn on i have tried to reset but it did not help

    hi i am having difficulty with my iphone 4s it has been on charge for a number of hours but is just flashing the apple logo continuously i have tried to reset but nothing seems to work can anyone help me please

    What is a hard reset?  There is nothing in any of Apple's documentation that refers to a hard reset.
    There's a reset, a restart, and a restore.
    Please explain EXACTLY what you did.

  • Can the calendar on the ipad show a 12 hour format instead of 24 hour?

    I want my calendar on my ipad to only show a 12 hour format instead of a 24 hour one. Is this possible and if so how do i change it?

    I'm sorry - I misunderstood you. You only want to see the first 12 hours of the day. Is that correct? If that is what you want to do, I don't think that's possible to remove 12 hours from the calendar view.

  • Time recording in 12 hour format with CATS??

    Hi CATS gurus,
    Can some body let me know, whether it is possible to record time using CATS in 12 hour format using the clock times.
    I need to record time as 08:00 am to 04:30 pm and the system shoud count it as total of 08:30 hours.
    Incase, my query is not clear, please feel free to write me back.
    Thanks & Regards, Swapnil Mishra

    Hi,
    In the CAC1 tCode, in the data entry profile you need to select the With clock times.
    As per ur requrirement you have created the work scheudles. you assigend that work scheudle in 0007 for the employee.
    While going to CAT2 tcode. there next to total colum one column is there WE  there you can give the total hrs. on the basis of
    works Schedule system will take that attendacne in the 2002 infotype. Then you can approve and transfer to HR through CAT4.
    Then you can go and see in the 2002 infotype there you can see the start time and end time.
    If you have any query's on this please let me know.
    Thanks and Regards,
    Revathi.

  • I want to convert number to hours in oracle 10 like this.

    Dear All
    Some can help me
    I want to convert below MS-SQL query in oracle 10g. please help me.
    for eg:
    Select numasdate,
    Cast(numasdate / 60 as Varchar) + ' hours ' +
    Cast(numasdate % 60 as Varchar) + ' minutes'
    as [TotalHoursAndMinutes]
    From
    #SampleTable
    Output:
    9436 157 hours 16 minutes
    537 8 hours 57 minutes
    9323 155 hours 23 minutes
    12525 208 hours 45 minutes
    Edited by: Parwez on Jan 1, 2013 5:33 AM

    I want to convert number to hours in oracle 10g like this.
    537 8 hours 57 minutes
    9436 157 hours 16 minutes
    12525 208 hours 45 minutesTry this...
    Ranit>> with xx as(
      2      SELECT 537 num from dual UNION ALL
      3       SELECT 9436 num from dual UNION ALL
      4       SELECT 12525 num from dual
      5  )
      6  select
      7       num,
      8       FLOOR(num/60)||' hrs' as "hrs",
      9       MOD(num,60)||' minutes' as "minutes",
    10       FLOOR(num/60)||' hrs  '||MOD(num,60)||' minutes' as "Hours.Mins"
    11  from xx;
           NUM hrs                                          minutes                                          Hours.Mins                                                                                                        
           537 8 hrs                                        57 minutes                                       8 hrs  57 minutes                                                                                                 
          9436 157 hrs                                      16 minutes                                       157 hrs  16 minutes                                                                                               
         12525 208 hrs                                      45 minutes                                       208 hrs  45 minutes                                                                                                Edited by: ranit B on Jan 1, 2013 6:51 PM
    --- Hey John... I just did it and saw your hint now !!!

  • Confirmation error - Number of hours recorded  exceeds target hours 0,00

    Hello Friends,
    I am getting one error in service confirmation . Service confirmation did not go through R/3 properly.
    Also how system checks recorded hours against target hours ?
    We can find recorded hours in Actual duration column but where we can see targeted hours?
    Error message is described below , can you pl let me know what should I do to fix it.
    An error has occured in the system KRP810 while copying the document
    Number of hours recorded 57,00 exceeds target hours 0,00 (Notification W LR 206)
    Amount field has zero value in CO Document (Notification E 000)
    Updating could not be completed (Notification E S& 150)
    Pl advice.
    Nitin

    need to replace confirmation

  • How do I get the hour (24 hour format) from a stored Time value

    I have a field called start_time in a mysql database and all I need to do but unable to do so far is extract the hour in 24 hour format (no leading zeros) from this field.  I have tried all the date functions including date('G'), getdate and start_time[hours] array.
    I keep getting either todays date & time, or just he first digit in the hour.
    The following is the closest it has come to working but this is the on ethat is return just the first digit of the hour if there is two digits in the 24 hour format (ex:  2 pm = 14, it returns oly the 1)
    <?php
    $start_time = $row['start_time'];
    $hour = $start_time[hours];
    ?>
    PLEASE HELP !  I have spent too much time on such a menial task.  I think part of my problem is I am running PHP 4.
    Thanks in advance,
    Marcus

    Thanks for the response David:
    Do you mean like the following ?  I don't seem to get a value
    <?php
         mysql_select_db($dbname,$link_id);
          $lookup = "SELECT * FROM $tbl";
          $result = mysql_query($lookup);
              while ($row = mysql_fetch_array($result))
                    $query = "SELECT HOUR(start_time) AS start_hour FROM $tbl";
                    $rslt = mysql_query($query);
                    $hour = $row['start_hour'];                  //  I tried using $rslt['start_hour']; as well and that did not work either
                   echo $hour;
    ?>
    I'm sure its something elemtary I'm missing now.
    Any help is always appreciated David.
    Marcus

Maybe you are looking for