I want to get the current system time and compare with the two different timing example start time as 2:00:00AM and end as 6:00:00AM. if my current system time falls between these i have to execute my rest of the code and show the output in textview. i have this use this code for getting the current time i need help for using start and end time in if condition.
enter code here
TextView tvTime = (TextView)findViewById(R.id.textView1);
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss a");
Calendar c = Calendar.getInstance();
if (if (c.getTime() == 2:00:00 AM && < 6:00:00 AM) {
tvTime.setText(" " + timeFormat.format(c.getTime()));
}