I am building an app, and I need to know how to compare two hours.
For example, my store opens at 6:30 AM and closes at 5:00 PM.
I need to show in a TextView
that after 5 PM my store is closed, and after 6:30 AM my store is open, from Monday to Friday.
How can I do this? This is my attempt:
public void timer() {
Calendar c = Calendar.getInstance();
int timeOfDay = c.get(Calendar.HOUR_OF_DAY);
int open = 6:30; // 1 ERROR HERE WITH ":"
int close = 17;
if (timeOfDay < close) {
hour.setText.("OPEN");
}
}
But I am getting multiple errors. One in int open when I put 06:30 with ":"; two with limit of Monday to Friday.
Thanks for the help.