How to convert Object as timestamp to formatted date?

I have printed out timestamp(

> 
> 1395500668
> 
> 
> 

) that is in Object.
I want to format this and print it out like 

> 
> yyyy-MM-dd H:m:s
> 
> 
>