How to get day from date in Java using Calendar?

 
 

Share on Google+Share on Google+

Java Coder
How to get day from date in Java using Calendar?
1 Answer(s)      8 months ago
Posted in : Java Beginners
Ads

Hi,

I have a calendar object in my Java program. How I can get the day of date from this?

How to get day from date in Java using Calendar?

Thanks

Ads
View Answers

April 16, 2017 at 8:58 PM


Hi, If you don't have calendar object then you should first create it and then you can easily get the day of week from this.

Following program works very well:

int weekday = calendar.get(Calendar.DAY_OF_WEEK);

You can also check this tutorial Find Day of Month for more details.

Thanks


Ads









Ads

 
Advertisement null

Ads