Code example for GregorianCalendar

Methods: format, setTimeInMillis

0
			return; 
		} 
		dbHelper = new DatabaseHelper(MainService.this);
		db = dbHelper.getWritableDatabase();
		 
		cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.US);
		cal.setTimeInMillis( l.getTime() );
		 
		data = new ContentValues();
		data.put("day", DateFormat.format("yyyyMMdd", cal).toString() );
		data.put("hour", DateFormat.format("hh", cal).toString() );
		data.put("milliseconds", l.getTime());
		data.put("longitude", l.getLongitude());
		data.put("latitude", l.getLatitude());
		data.put("altitude", l.getAltitude());
		data.put("gpsStart", lGPSTimestamp);
		data.put("accuracy", l.getAccuracy());
		data.put("bearing", l.getBearing());
		data.put("speed", l.getSpeed());
		data.put("provider", l.getProvider());
		db.insert("locations", null, data);