Code example for Timestamp

Methods: toString

0
    public void saveResults(double dist, double fuel, double mileage, double start, double end) {
        double length = ((end-start)/(1000*60));
 
        ContentValues values = new ContentValues();
        values.put(C_DISTANCE, dist);
        Timestamp time = new Timestamp((long) start);
        String stime = time.toString();
        values.put(C_TIME, stime);
        values.put(C_LENGTH, length);
        values.put(C_FUEL, fuel);
        values.put(C_MILEAGE, mileage);
        SQLiteDatabase db = getWritableDatabase();
        db.insertOrThrow(TABLE, null, values);
        Log.i(TAG, "Insertion complete");
    } 
 
    public void createTestData(int num) {
        for (int i=1; i < num; i++) {
            DateTime endDt = new DateTime();
            endDt = endDt.minusHours(6);
            DateTime startDt = endDt.minusWeeks(10);