Answers for "get time from timestamp android"

-1

How to convert timestamp to time in android studio

//Timestamp to HH:mm:ss format
Long Timestamp = 1633304782;
Date timeD = new Date(Timestamp * 1000);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

String Time = sdf.format(timeD);

//RESULT this code convert 1633304782 to 05:46:33
Posted by: Guest on October-04-2021
0

Get time android

Calendar c = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss a");
        String strDate = sdf.format(c.getTime());
        Log.d("TAG","DATE : " + strDate);
Posted by: Guest on February-27-2022

Code answers related to "get time from timestamp android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language