Code example for SimpleDateFormat

Methods: getCalendar, parse

0
		this.datetime = Calendar.getInstance();
		this.datetime.setTimeInMillis(timeInMillis);
	} 
	 
	private void setDateTime(String datetime) {
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try { 
			format.parse(datetime);
		} catch (ParseException e) {
			Log.e("APPLICATION", "Erro ao parsear data e hora: " + datetime, e);
		} 
		this.datetime = format.getCalendar();
	} 
	 
	@Override 
	public boolean equals(Object o) {
		if(o instanceof Speech) {
			Speech speech = (Speech) o;
			return (id == speech.id);
		} 
		return super.equals(o);