How to get day from date in Java using Calendar?

How to get day from date in Java using Calendar?

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

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









Related Tutorials/Questions & Answers:
How to get day from date in Java using Calendar?
How to get day from date in SQL?
Advertisements
How to get month name from date(like-25/06/2012) using java?
How to get day of week in Java?
how to get date format in string from date object containing real date in java
how to get date format in string from date object containing real date in java
How to get the Day name
How to get the current date in Java?
Java Get Month from Date
Java get Next Day
Java Get Method
JDBC : Get year from Date
How do I learn Java programming in one day from zero?
How do I learn Java programming in one day from zero?
Java date add day
Get first day of week
how to get data from list to map with out using a loop?
How to get the data from the database using Servlet or JSP program
Java current date - How to get current date in Java
How to get data from Oracle database using JSP
Java get year from date
How to get today's date in java in mm/dd/yyyy format?
how to get harddisk info using S.M.A.R.T using java
java how to get domain name from url
Java subtract days from date
Java subtract months from date
Java subtract years from date
How to get max date in Hibernate?
get data between date using jsp with msaccess
get data between date from msaccess database
Java get yesterday's date

Ads