+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 29

convert duration in seconds to hh:mm:ss

  1. Re: convert duration in seconds to hh:mm:ss

    Thanks Serge.
    It provides the time since midnight, where as I need 125 seconds as
    00:02:05, now it outputs as 12:02:05
    Any tweaks available?


  2. Re: convert duration in seconds to hh:mm:ss

    Thanks Serge.
    It provides the time since midnight, where as I need 125 seconds as
    00:02:05, now it outputs as 12:02:05
    Any tweaks available?


  3. Re: convert duration in seconds to hh:mm:ss

    Thanks Serge.
    It provides the time since midnight, where as I need 125 seconds as
    00:02:05, now it outputs as 12:02:05
    Any tweaks available?


  4. Re: convert duration in seconds to hh:mm:ss

    Thanks Serge.
    It provides the time since midnight, where as I need 125 seconds as
    00:02:05, now it outputs as 12:02:05
    Any tweaks available?


  5. Re: convert duration in seconds to hh:mm:ss

    Thanks Serge.
    It provides the time since midnight, where as I need 125 seconds as
    00:02:05, now it outputs as 12:02:05
    Any tweaks available?


  6. Re: convert duration in seconds to hh:mm:ss

    hikums@gmail.com wrote:
    > Thanks Serge.
    > It provides the time since midnight, where as I need 125 seconds as
    > 00:02:05, now it outputs as 12:02:05
    > Any tweaks available?

    Local format...let's go ISO:

    CREATE FUNCTION formatseconds(sec INT)
    RETURNS CHAR(8)
    DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL
    RETURN REPLACE(CHAR(TIME('00:00:00') + 125 seconds, ISO), '.', ':');

    db2 => values formatseconds(125);

    1
    --------
    00:02:05

    1 record(s) selected.

    --
    Serge Rielau
    DB2 SQL Compiler Development
    IBM Toronto Lab

  7. Re: convert duration in seconds to hh:mm:ss

    hikums@gmail.com wrote:
    > Thanks Serge.
    > It provides the time since midnight, where as I need 125 seconds as
    > 00:02:05, now it outputs as 12:02:05
    > Any tweaks available?

    Local format...let's go ISO:

    CREATE FUNCTION formatseconds(sec INT)
    RETURNS CHAR(8)
    DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL
    RETURN REPLACE(CHAR(TIME('00:00:00') + 125 seconds, ISO), '.', ':');

    db2 => values formatseconds(125);

    1
    --------
    00:02:05

    1 record(s) selected.

    --
    Serge Rielau
    DB2 SQL Compiler Development
    IBM Toronto Lab

  8. Re: convert duration in seconds to hh:mm:ss

    hikums@gmail.com wrote:
    > Thanks Serge.
    > It provides the time since midnight, where as I need 125 seconds as
    > 00:02:05, now it outputs as 12:02:05
    > Any tweaks available?

    Local format...let's go ISO:

    CREATE FUNCTION formatseconds(sec INT)
    RETURNS CHAR(8)
    DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL
    RETURN REPLACE(CHAR(TIME('00:00:00') + 125 seconds, ISO), '.', ':');

    db2 => values formatseconds(125);

    1
    --------
    00:02:05

    1 record(s) selected.

    --
    Serge Rielau
    DB2 SQL Compiler Development
    IBM Toronto Lab

  9. Re: convert duration in seconds to hh:mm:ss

    hikums@gmail.com wrote:
    > Thanks Serge.
    > It provides the time since midnight, where as I need 125 seconds as
    > 00:02:05, now it outputs as 12:02:05
    > Any tweaks available?

    Local format...let's go ISO:

    CREATE FUNCTION formatseconds(sec INT)
    RETURNS CHAR(8)
    DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL
    RETURN REPLACE(CHAR(TIME('00:00:00') + 125 seconds, ISO), '.', ':');

    db2 => values formatseconds(125);

    1
    --------
    00:02:05

    1 record(s) selected.

    --
    Serge Rielau
    DB2 SQL Compiler Development
    IBM Toronto Lab

  10. Re: convert duration in seconds to hh:mm:ss

    hikums@gmail.com wrote:
    > Thanks Serge.
    > It provides the time since midnight, where as I need 125 seconds as
    > 00:02:05, now it outputs as 12:02:05
    > Any tweaks available?

    Local format...let's go ISO:

    CREATE FUNCTION formatseconds(sec INT)
    RETURNS CHAR(8)
    DETERMINISTIC NO EXTERNAL ACTION CONTAINS SQL
    RETURN REPLACE(CHAR(TIME('00:00:00') + 125 seconds, ISO), '.', ':');

    db2 => values formatseconds(125);

    1
    --------
    00:02:05

    1 record(s) selected.

    --
    Serge Rielau
    DB2 SQL Compiler Development
    IBM Toronto Lab

+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast