• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to check if current time falls between time period

GaryDoo

Newbie
Hi,

I have tried searching the database for this and googled it and I couldn't find anything.

I'm not very experienced in Android, however, I am trying to develop an application. Within the application I want to check if the current time falls between time ranges

pseudo code

[HIGH]if (currTime > 9am AND currTime < 7pm)
{
//do this
}
else if (curTime>7pm AND currTime <10pm)
{
//do that
}

else if(curTime>10pm AND currTime <2am)
{
//do the other
}[/HIGH]

I don't normally ask on forums how do I do this but with this I am clueless, I have never had any use for time in my past. :confused:

So if anyone could help, I'd appreciate it.

Regards,
Gary
 
Back
Top Bottom