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
how to get data from list to map with out using a loop?
Get first day of week
How to get the data from the database using Servlet or JSP program
How to get data from Oracle database using JSP
Java current date - How to get current date in Java
Java get year from date
How to get today's date in java in mm/dd/yyyy format?
get data between date using jsp with msaccess
How to get max date in Hibernate?
java how to get domain name from url
how to get harddisk info using S.M.A.R.T using java
Java subtract days from date
Java subtract months from date
Java subtract years from date
get data between date from msaccess database
How to get sub category based on category from database using jsp and javascript.
How to get yesterday date in Python?
Java get yesterday's date
How do i get the number of online users from a site using jsp?
How to get the text from textarea in HTML and store it in database using javascript and jsp
how to add date and change date in java - netbeans
how to write to java program to get the particular data from the website
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
get from address using javamail api?
How to values from xml using java?
How to read value from xml using java?
How to capture picture from webcam using java
Getting Previous, Current and Next Day Date
how to get the values from dynamically generated textbox in java?
get info from mysql using jsp and servlet
How to get Page Source in Selenium (WebDriver) using Java?
How I get a variable from java script to use it in the scriptlet of jsp.
How to learn Java in just one day
How to save and get value from JSP

Ads