Display the message depend on time

Posted by sairam333 on Stack Overflow See other posts from Stack Overflow or by sairam333
Published on 2010-05-18T07:14:14Z Indexed on 2010/05/18 7:20 UTC
Read the original article Hit count: 268

Filed under:

Hi i am getting current time using the following statements

 Calendar cal = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
  String  b= sdf.format(cal.getTime());

Now I want to display the message as if time is before 12 Good Morning like that......... for this how can i compare that time with integers 1 , 12,16 like that. Thanks in advance

© Stack Overflow or respective owner

Related posts about java