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

 
 


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

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 Pages:
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
DATE
of calcultion starts My question is how to find the date of Thursday This cycle... the date of all the thursdays of the given year. import java.util.*; import...DATE  I have the following as my known parameter Effective Date
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
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 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 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
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
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
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
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
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 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
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
Find the Day of the Week
Find the Day of the Week       This example finds the specified date of  an year and a day... Object class and converts a Date object into a set of integer fields. Calendar
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
Get the smallest double greater than the given value
Get the smallest double greater than the given value This section demonstrates you how to get the smallest double value greater than the given value. Java has provide several classes for formatting different objects like, number, date
date_sunrise
  date_sunrise date_sunrise function returns time of sunrise for a given day and location.  Description on PHP Date Sunrise Function mixed... date_format($datetime, DATE_ATOM); ?> Find Example of date_sunsunrise
PHP Date function
echo ("<B>Different format of Date is given below </b><br>... of Date is given below October 9, 2009, Friday,12:34 pm it is tenth month...PHP Date Function In this section we will show you the different formatting
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      
Date Formay - Date Calendar
Date Formay  Sir, How to comapare two different date format...(currentcal.getTime()) + ") is greater than the given date " + new SimpleDateFormat...(currentcal.getTime()) + ") is less than the given date " + new
Date limit on Dojo Date picker - Date Calendar
want to Date limit for date picker i.e. If i given date limit from 31/03/2008... beyond or before date limit from dojo date picker itself. It means how to disable...Date limit on Dojo Date picker  Hi all, I am using dojo for date
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
PHP Date add 1 year
to add 1 year easily. The code given below will show how you can add 1 year in php program. <?php //Example to add 1 year to a date object... Adding 1 year to a php date object is sometimes useful to solve some
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
date
date   how to insert date in database? i need coding
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
MySql date problem
MySql date problem  with a mysql query, how can you get records of previous week dynamically, starting from sunday and ending on saturday? I don't want records from current date, just the previous week
SQL Date, SQL Date Examples
The Tutorial describe a example that help you  in find out the current date... to find the minimum records value of a date field from a table 'employees... illustrate an example from 'Mysql Date Last 30 days'. To grasp this concept we find
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
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
date
date  actually i need to print morning , evening from config file .tell me the idea .how do i get coding
Mysql Date Last 30 Days
; Mysql is used to find out the last 30 days from current date... days'. To grasp this concept we find out the current date. The Syntax used to find out the current date:  curdate ( ) :The Query curdate ( ) help you to find
days between two given dates using PHP
days between two given dates using PHP  How can we know the number of days between two given dates using PHP?   Hi friends, Example...;"; // Number of days in between to given date in php $days = (strtotime
Mysql Date Filter
Mysql Date Filter       Mysql Date Filter is used to find the date portion of the timestamp... rows in set (0.00 sec) Query for filtering the record by date:- The given
Find position of an array element
Find position of an array element In this section, you will learn how to find... the position of the given integer in array. If the given integer is not in the array...] = input.nextInt(); } System.out.println("Enter element to find its position
Java Find Automorphic numbers
Java Find Automorphic numbers In this section, you will learn how to find... square ends with the given integer. For example,5 is an automorphic number... of number 6 at the end. Here we are going to find the automorphic numbers between 1
Objective c date: NSString Date
Objective c date: NSString Date In_ the given objective c date functions example, we are going to show you how to print the current date using NSDate of NSString class. To print the current date on iphone we required, a lable(to print
array find all possible dimension
array find all possible dimension  Given array: int[] dimension = { 1, 2, 3 }; That produces the output: 1 2 3 12 13 23 123 I'm new to array...i can't figure out the way on even how to start... any idea?...really appreaciate
Find Sum of Diagonals of Matrix
Find Sum of Diagonals of Matrix You all know that a matrix is a rectangular... elements. Here we are going to find the sum of Primary diagonal (From left top...) of the matrix from the given two dimensional array. See the following matrix
Find Zodiac Sign
Find Zodiac Signs using Java Programming In this section, you will learn how to find the zodiac sign and chinese sign. For this, We have differentiated all... is differentiated according to the zodiac sign. The given program prompt the user to enter his
shortest path from the given source to dstination
to find the shortest path from the given source to destination based on the databse values. How do I do? Please report quickly. Thanks in advance...shortest path from the given source to dstination  Hi. Here in my
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
Shortest path in JSP for a given source and destination
Shortest path in JSP for a given source and destination  Hi. Here...,'Madurai','Bangalore',5), (7,'Bangalore','Kanchipuram',20); Now i want to find the shortest path from the given source to destination based on the databse values. I
Shortest path in JSP for a given source and destination
Shortest path in JSP for a given source and destination  Hi. Here...,'Madurai','Bangalore',5), (7,'Bangalore','Kanchipuram',20); Now i want to find the shortest path from the given source to destination based on the databse
Java find the roots of quadratic equation
Java find the roots of quadratic equation In this tutorial, you will learn how to find the roots of quadratic equation. Quadratic Equations are always.... And this program is implemented to find the roots of the quadratic equation. The given