Home > PL/SQL > [PL\SQL] Convert seconds to Day hour : min : sec

[PL\SQL] Convert seconds to Day hour : min : sec

Thursday, 2 July, 2009 Leave a comment Go to comments

variable vSec number;
exec :vSec := 68400;
SELECT
to_char(trunc(:vSec / 60 / 60 / 24), '09') || ' [day]' ||
to_char(trunc(MOD(:vSec / 60 / 60, 24)), '09') ||' [hh24]' ||
to_char(trunc(MOD(:vSec, 3600) / 60), '09') || ' [mi]' ||
to_char(MOD(MOD(:vSec, 3600), 60), '09') || ' [ss]'
FROM dual;
Advertisements
Categories: PL/SQL Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: