How to get day from date in Java using Calendar?

Ads
 

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 the Day name
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
Java get Next Day
How to get the current date in Java?
Day for the given Date in Java
Java Get Month from Date
Java Get Method
How can we get second of the current time using date function?
JDBC : Get year from Date
Java date add day
Get first day of week
Java current date - How to get current date in Java
java how to get domain name from url
how to get harddisk info using S.M.A.R.T using java
how to get current date without system date
How to get data from DB in to Text box by using Jsp & Ajax
how to get data from list to map with out using a loop?
Java get year from date
Java subtract days from date
Java subtract months from date
Java subtract years from date
How to get the data from the database using Servlet or JSP program
How to get data from Oracle database using JSP
How to get max date in Hibernate?
Java get yesterday's date
How to get bytes from ByteBuffer in java.

Ads