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









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
Day for the given Date in Java
How to get the current date in Java?
Java Get Month from Date
How can we get second of the current time using date function?
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 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?
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 max date in Hibernate?
How to get today's date in java in mm/dd/yyyy format?
get data between date using jsp with msaccess
python add 1 day to date
java how to get domain name from url
how to get harddisk info using S.M.A.R.T using java
Java subtract months from date
Java subtract years from date
Java subtract days from date
get data between date from msaccess database
python add one day to date
python add one day to date
Get date data type from table
How to get yesterday date in Python?
How to get bytes from ByteBuffer in java.
Get Last Day of The Month
How to get sub category based on category from database using jsp and javascript.
Java get yesterday's date
How do i get the number of online users from a site using jsp?
JSP:How to get year of system date - Date Calendar
How to get the text from textarea in HTML and store it in database using javascript and jsp
how to write to java program to get the particular data from the website
how to add date and change date in java - netbeans
how to get mail exchange records using java dns protocol
How to get the data from the database (Oracle) in console or in ie using servlet or jsp as Front end

Ads