Android - get date time from SMS timestamp in miliseconds

こ雲淡風輕ζ 提交于 2019-11-29 15:29:19

just do

long ms = 1293457709636; // or whatever you have read from sms
Date dateFromSms = new Date(ms);

You can convert Sms table date in to meaningful Date time like this.

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");
Calendar calendar = Calendar.getInstance();
long now = 1293457709636L;
calendar.setTimeInMillis(now);
Log.i("time", "time"+formatter.format(calendar.getTime()));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!