Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how to find the given date is sunday

Have Programming Question? Ask it here!
 
 
 


Pushpa Sheela
how to find the given date is sunday
2 Answer(s)      3 years and 9 months ago
Posted in : Java Beginners


how to find the given date is sunday in java?


Advertisement
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: import...=f.format(date); if(day.equals("Sunday")){ System.out.println("20-09-2010
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: DECLARE @dtDate DATETIME SET @dtDate = '8/18/2007' SELECT DATEADD(s,-1,DATEADD
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...("Enter date(1-31):"); int dd=input.nextInt(); System.out.println("Enter...("Enter year: "); int year=input.nextInt(); Date date= (new GregorianCalendar
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
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
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 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
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 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
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
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 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 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:00 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) Could you please
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
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
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... will demonstrate you about how to find the next date of the input date
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 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 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 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
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
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
Get Date and Time
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 created instance
How to find a config file in spring project
How to find a config file in spring project  how to find configuration file in the spring project
how to find which user has modified the file
how to find which user has modified the file  how to find which user has modified the file
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 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
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
Find Day of Month
Find Day of Month       This example explores how to find the day of a month and the day... a Date object into a set of integer fields. Calendar class provides
how to find the sum of integers in a string of sentence in java
how to find the sum of integers in a string of sentence in java  how to find the sum of integers in a string of sentence in java for e.g:--> abc d 2 3 21 the output should be 2+3+21=26
How to find java jobs at any where in india
How to find java jobs at any where in india   Hi, I want information about java related jobs in india.where can i find that details
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 find the first 6 characters of string in regex?
How to find the first 6 characters of string in regex?  How to find the first 6 characters of string in regex. I know the Syntax... need the syntax to find the first 6 characters of string in regex using java
How to use find method in Java - Java Beginners
How to use find method in Java  Hello, I want to write a class that gets a web page, parses it, and tries to find an object with certain properties. How can I do this? I was thinking, maybe get child objects of the browser
Java Get Month from Date
Java Get Month from Date       In the given example, you will see how to retrieve the current month from the current date using Java Application Language.  You can see
How to find latitude and longitude of my Mobile Phone?
How to find latitude and longitude of my Mobile Phone?  Hi, What is the best method to find the latitude and longitude of my current location in my... then you can use any GPS enabled application to find the current latitude
Current Date iPhone SDK
Current Date iPhone SDK In this example, you'll find out how to get current date & day in iPhone SDK. We'll also write a method to print the day and date...! If not lets first find out what is NSdateFormatter in iPhone SDK programming
In data structure in java how to parse the given string and counts the member of character that match the given data?
In data structure in java how to parse the given string and counts the member of character that match the given data?  Design a parser that parse the given string and counts the member of character that match the given data.using
How to write the given byte into byte buffer.
How to write the given byte into byte buffer.  In this tutorial, we will see how to writes the byte into byte buffer by using  put(byte b) method of ByteBuffer class. ByteBuffer API: The java.nio.ByteBuffer class
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
How to use Date Picker iPhone
How to use Date Picker iPhone  Hi, I am beginner in mobile Application platform. I want to develop a small application in iphone platform to Show current date and display alert view message. So, how to define the date picker
how to find square and cube of five number
how to find square and cube of five number  how to find square and cube of five number   Hi Friend, Try the following code: <html> <script> document.writeln("Square of 5 numbers:<br><br>
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
 

 

 

DMCA.com