Code example for Date

Methods: toString

0
		mDbHelper.close();
	} 
 
	public long createGame() { 
		ContentValues values = new ContentValues();
		Date date = new Date(System.currentTimeMillis());
		values.put("created_at", date.toString());
 
		return mDb.insert("games", null, values);
	} 
 
    public boolean deleteGame(long gameId) {
    	Cursor c;
    	long playerId;
    	if (mDb.delete("games", "_id = " + gameId, null) > 0) {
    		// delete players associated with this game 
    		c = mDb.query("players", new String[] { "_id" }, 
    				"game_id = " + gameId, null, null, null, null);
    		for (int i = 0; i < c.getCount(); i++) {
    			c.moveToPosition(i);
    			playerId = c.getLong(0);