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?
Day for the given Date 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
Java Get Month from Date
How to get the Day name
Java get Next Day
How do I learn Java programming in one day from zero?
How do I learn Java programming in one day from zero?
How to get the current date in Java?
How can we get second of the current time using date function?
Java Get Method
JDBC : Get year from Date
Java date add day
Get first day of week
Java get year from date
python add 1 day to date
python add one day to date
python add one day to 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?
Get Last Day of The Month
How to get the data from the database using Servlet or JSP program
Java subtract days from date
Java subtract months from date
Java subtract years from date
How to get data from Oracle database using JSP
how to get current date without system date
Java current date - How to get current date in Java
get data between date using jsp with msaccess
get data between date from msaccess database
ModuleNotFoundError: No module named 'calendary'
Java get yesterday's date
How to learn Java in just one day
How to get today's date in java in mm/dd/yyyy format?
Get date data type from table
PHP Date add 1 day
How to get max date in Hibernate?
How to values from xml using java?
How to read value from xml using java?
How to capture picture from webcam using java
how to get harddisk info using S.M.A.R.T using java
java how to get domain name from url
Subtraction of a date from Sql and other from java.
How to get yesterday date in Python?
storing date from html form to oracle 10g using servlet
storing date from html form to oracle 10g using servlet

Ads