I used
SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy, HH:mm"); String time = formatter.format(new Date());
to get the time (03/12/2012, 17:31), now I want to convert this time to milliseconds, because I have a file with the date and text of the pair, and I want to convert the dates in milliseconds so that I can not add text to the incoming using
ContentValues values = new ContentValues(); values.put("address", "123"); values.put("body", "tekst"); values.put("read", 1); values.put("date", HERE I MUST PUT A DATE IN MILLISECONDS); context.getContentResolver().insert(Uri.parse("content://sms/inbox"), values);
Because I have to put time in milliseconds, I have to convert time, does anyone know how?
source share