how to find the given date is sunday

how to find the given date is sunday

how to find the given date is sunday in java?

View Answers

October 23, 2010 at 12:58 PM

Hi Friend,

Try the following code:

import java.util.*;
import java.text.*;
class  CheckDay{
   public static void main(String[] args){
   Date date= (new GregorianCalendar(2010, Calendar.SEPTEMBER, 20)).getTime();
   SimpleDateFormat f = new SimpleDateFormat("EEEE");
     String day=f.format(date);
     if(day.equals("Sunday")){
     System.out.println("20-09-2010 was a Sunday");
     }
     else{
     System.out.println("No, it was "+day);
     }

    }
}

Thanks


October 25, 2010 at 11:51 AM

Thankyou. its working fine.









Related Tutorials/Questions & Answers:
how to find the given date is sunday
how to find the given date is sunday  how to find the given date is sunday in java?   Hi Friend, Try the following code:ADS_TO_REPLACE_1..."); String day=f.format(date); if(day.equals("Sunday")){ System.out.println
is this programm efficient to find the day of the given date . can it be more normalized ?
is this programm efficient to find the day of the given date . can it be more normalized ?  #include <stdio.h> int main(void) { int dd...] ; strcpy(week[0], "Sunday") ; strcpy(week[1], "Monday") ; strcpy(week[2
Advertisements
how to find last day 0f any given month in mysql?
how to find last day 0f any given month in mysql?  how to find last day of any given month in mysql?   Hi Friend, Here is required code:ADS_TO_REPLACE_1 DECLARE @dtDate DATETIME SET @dtDate = '8/18/2007' SELECT
how to find subarray from given large 2d array of arbritary dimension
how to find subarray from given large 2d array of arbritary dimension  my code is: import java.lang.*; import java.io.*; import java.io.File; import... to print the subarray of any dimension from given array file. i have tried upto
Day for the given Date in Java
Day for the given Date in Java  How can i get the day for the user...); System.out.println("Enter date(1-31):"); int dd=input.nextInt...; System.out.println("Enter year: "); int year=input.nextInt(); Date date= (new
find the given input is integer or string
find the given input is integer or string  simple coding for to check the given input value is integer or no.If the given value is integer display "Value is integer" otherwise "Value is not a integer"?   class
ModuleNotFoundError: No module named 'sunday'
'sunday' How to remove the ModuleNotFoundError: No module named 'sunday'...ModuleNotFoundError: No module named 'sunday'  Hi, My Python... to install padas library. You can install sunday python with following command
ModuleNotFoundError: No module named 'sunday'
'sunday' How to remove the ModuleNotFoundError: No module named 'sunday'...ModuleNotFoundError: No module named 'sunday'  Hi, My Python... to install padas library. You can install sunday python with following command
ModuleNotFoundError: No module named 'sunday'
'sunday' How to remove the ModuleNotFoundError: No module named 'sunday'...ModuleNotFoundError: No module named 'sunday'  Hi, My Python... to install padas library. You can install sunday python with following command
Find whether a date will be in the current quarter or the next quarter
and is not yet over so my end date should be calculated as 23-09-2012 How to find...Find whether a date will be in the current quarter or the next quarter   I have a date - example - 22-09-2012(start date) I have to find my end date
Finding A Date
end date - not defined Calculation Frequency is Weekly(Sunday) My calculation will be from 24-08-2012 to the following sunday My question is how to find the following date of sunday
Finding Last Modification Date of a file
Get the Last Modification Date      Get the Last Modification Date This section contains the detail about how to get the last modification date of a file
ModuleNotFoundError: No module named 'MS-fun-Sunday'
'MS-fun-Sunday' How to remove the ModuleNotFoundError: No module named 'MS-fun-Sunday' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'MS-fun-Sunday'  Hi, My
Find the date of the file before the file has been modified
Find the date of the file before the file has been modified  Hi, may i know is it possible to find the date of the file before the file has been modified?   hi friend, you can get the date of last modified file using
Write a program to find a factorial in any given number
Write a program to find a factorial in any given number This programming tutorial will teach you how to write a factorial of any given number... that is equal to 24, and factorial of  0! is 0 always.Example : A program to find
Find out the prime number
to find out whether a given number is prime or not. Here we have used the 'for loop' statement and given the required condition for a prime number. As we know... Find out the prime number      
how to add date and change date in java - netbeans
how to add date and change date in java - netbeans  I need to code use to increase date How to get date after 30 days using netbeans
How to compare date in Java?
How to compare date in Java?  Hi, How to compare date in Java? Thanks   Hi, Check this example Date Comparison. Thanks
Java Find Next Date Example
Java Find Next Date Example In this example we will discuss about how to find the next date of the input date. This example explains you about how... a simple example which will demonstrate you about how to find the next date
How to display date in JSP?
How to display date in JSP?  How to create a simple JSP program which displays date on the page? Thanks
date_parse
date_parse() in PHP date_parse function returns associative array with detailed information about given date. It returns information about the date on success, or FALSE on failure. An error message will display if date format faces any
Java file modified date
Java file modified date In this section, you will learn how to find the modification date and time of the file. Description of code: We have created... that will return the modification date and time of the file. This return value
how to get current date without system date
how to get current date without system date  is there any possiblity to get current date instead of system date in Java, as i dont want to change date in program and if i change date in OS automatically change in program also
How to Convert String to Date?
How to Convert String to Date?  Hi, I am new in Java and learning the Date manipulation in Java. I have to write a program in Java which converts... have to convert it to Date object. Tell me How to Convert String to Date? Thanks
Get Date and Time
;    In the example given below we will see, how to display current date and time in the user given format. To do all this we have first...;How to get date and time in Java?":ADS_TO_REPLACE_1
How to display current date in textbox - Date Calendar
How to display current date in textbox  Hi guys, I'm really need your... Date(); var month = currentTime.getMonth() + 1; var day...(); document.forms[0].date_stamp.value = day + "-" + month + "-" + year
How to display date in JSP?
How to display date in JSP?  How to create a simple JSP program which displays date on the page? Thanks   Hi, You should import...; Then use the following code to print the current date: <%= new java.util.Date
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
2. Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
2. Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1 Abracadabra, 2 Abracadabra, 3
Overview of Networking through JAVA,Find the Host name in reverse of given IP address
Find the Host name in reverse of given IP address       In this section you will learn to retrieve the information about the local host name using the getHostName() method
how to find jdk path in ubuntu?
how to find jdk path in ubuntu?  How to find out the path of installed jdk in ubuntu? Could anyone tell that command to execute from terminal.. Thanks
How to find hashtable size in Java?
How to find hashtable size in Java?  Hi, What is the code for Hashtable in Java? How to find hashtable size in Java? Give me the easy code. Thanks
How to Find PHP version and configuration?
How to Find PHP version and configuration?  Find PHP version and configuration   If you want to find the version of PHP, you can just run...: http://www.phpzag.com/find-php-version-and-configuration
How to build calander - Date Calendar
; // if a date format was given, update the dateFormat variable...How to build calander  My requirement is When user is registering he should enter his DOB just by selecting the date month and year for that i
How to find run time in SQL.
How to find run time in SQL.  I have 10 backend jobs in sql which... 22/10/2010 17:30:00ADS_TO_REPLACE_1 I want to find the run time of both the jobs. (i.e when i run the query it should show me how long job has been running
How to find a servlet object by name?
How to find a servlet object by name?  How can we locate a servlet object in the code by it's object name?   A. In web.xml you map servlet and define url pattern. Now this url-pattern is used for calling servlet. <
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to calculate Date Difference in Java?
How to calculate Date Difference in Java?  Hi, I have two dates variable. How to calculate Date Difference in Java? Thanks   Hi, You can...(); And then easily find the date difference. Check tutorial Date Difference
Mysql Date Subtract
Mysql Date Subtract       Mysql Date Subtract is used to find the date between the current date and the date before the current date. Understand with ExampleADS_TO_REPLACE_1
Mysql Date Name
Mysql Date Name       Mysql Date Name helps you to find out the current Date of the Month... you  in find out the current date of the month. date_format(now( ),'%e
How to index a given paragraph in alphabetical order
How to index a given paragraph in alphabetical order  Write a java program to index a given paragraph. Paragraph should be obtained during runtime... paragraph : This is a technical round. Please index the given paragraph. Output
Find Suitable Service Provider, How to Find a Suitable Company for Outsourcing
How to find a suitable outsourcing vendor Introduction:  Finding the right kind of outsourcing vendor is very critical to the success of the company that is outsourcing. The outsourcer should have a clear mind as to what
how to convert yyyyMMdd to date in python
how to convert yyyyMMdd to date in python  Hi, I have a date string 20221231 and I want to convert it to the date in Python. how to convert... is the similar example: How to get yesterday date in Python? Thanks
how to convert yyyyMMdd to date in python
how to convert yyyyMMdd to date in python  Hi, I have a date string 20221231 and I want to convert it to the date in Python. how to convert... is the similar example: How to get yesterday date in Python? Thanks
How to get the current date in Java?
How to get the current date in Java?  Hi, I am new to Java and trying to write a program to get the current date. How to get the current date in Java? Thanks   Hi, Check the tutorial: Java program to get current date
date
date   how to insert date in database? i need coding
How to get max date in Hibernate?
How to get max date in Hibernate?  Hi, Tell the code to get the max date in Hibernate? Thanks   Hi, You can use the projection in Hibernate for getting the max date. Here is example code: Projections.max("addmision

Ads