Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert from UNIX Timestamp to "Today at: currentTime" using Java

Tags:

java

android

I've tried to convert a UNIX Timestamp to todays date time.

Like I have a simple UNIX Timestamp and then I want to convert it like this:

Today at: theTimeFromMyTimestamp

Anyone that has a correct solution for this?

Thanks in advance!

like image 912
Curtain Avatar asked Dec 05 '25 15:12

Curtain


1 Answers

Try this DateFormat.getDateFormat(mContext).format(new Date(myTimestamp * 1000))

As new Date() requires milliseconds instead of seconds, you have to multiple by 1000

like image 64
WarrenFaith Avatar answered Dec 07 '25 04:12

WarrenFaith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!