cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert Seconds to Date Format dd-mm-yyyy hh:mm:sec.

Former Member
0 Kudos

Hi  all ,

My client gave me the time in sec for ex : 576210000.

I need to convert this sec into DD-MM-YYYY  HH:MM:sec.

Any suggestions or solutions would of great for me.

Thanks and Regards,

Kishan.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184768
Active Contributor
0 Kudos

Hi Kishan,

I think the simple way is to use the add_seconds function. Something like:

select add_seconds(to_timestamp('1900-01-01 00:00:00'), 576210000) "new_date" from dummy;

new_date

6 Apr, 1918 2:20:00.0 AM

Regards,

Ravi

rama_shankar3
Active Contributor
0 Kudos

Kishan:

Try this:

select variant_date - (576210000/60/60/24) from dual - where variant date can be the date you want to use to compare the difference. This will be the starting point to your requirement.

Let me know the full requirement on what you are trying to do so that I can provide additional tips.

Hope this helps.

Regards,

Rama

Former Member
0 Kudos

Before you can do it you need to understand when the date starts in your database... like 1//1/2000 00:00:00..  like what is the calendar date when your system date was 0

Without that it will not be possible to convert to any date

Former Member
0 Kudos

Hi Mishra ,

Thanks for the reply.My base date is 1990-01-01 00:00:00.

Can you please let me know how to convert the given sec into date format.

you can take your own example to lexplain the secnario. i can apply that strategy to mine.

Thanks in Advance.

Regards,

Kishan.

Former Member
0 Kudos

Try the approach as Rama suggested ..

Check if this formula works for you..

select  to_Date('1990-01-01 00:00:00','YYYY-MM-DD HH:MM:SS') - (Date_in_seconds/60/60/24) from dual

If this approach does not work please update ; you can also google "converting Epoch to human readable date" for additional ideas on conversion..