heybuddy
Finding A Date
1 Answer(s)      9 months ago
Posted in : Java Beginners

My Frequency Start Date is 24-08-2012

My frequency 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

View Answers

August 24, 2012 at 12:51 PM


Here is an example that determines the date on coming sunday from the specified date.

import java.util.*;
import java.text.*;

class  GetDateExample
{
    public static void main(String[] args) throws Exception
    {
    String str_date="24-08-2012";
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
    Date date = (Date)formatter.parse(str_date);
    Calendar cal=Calendar.getInstance();
    cal.setTime(date);
    while(cal.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY){
        cal.add(Calendar.DAY_OF_WEEK, 1);
    }
    System.out.println("Date on coming sunday is " + formatter.format(cal.getTime()));
    }
}









Related Pages:
Finding A Date
Finding A Date  My Frequency Start Date is 24-08-2012 My frequency end date - not defined Calculation Frequency is Weekly(Sunday) My calculation... the following date of sunday
date_diff
date_diff date_diff alias DateTime::diff returns the difference between two... [, bool $absolute ] ) Parameters datetime - The date to compare... "Correct order"; } else { echo "Incorrect order, end date is before
Doclet for finding missing comments - Java Tutorials
Doclet for finding missing comments 2002-06-05 The Java Specialists' Newsletter [Issue 049] - Doclet for finding missing comments Author: Dr. Heinz M... a Java specialist, especially if it can be done remotely. Doclet for finding
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
Date related query - Date Calendar
Date related query  hi, m a new biginner of java.i m intrested in finding out d difference in d two dates "in terms of number of days "entered by d user using bufferedReader. how can i convert a string into a date object.pls
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
finding java code on internet
finding java code on internet  Is there anybody to help me? i want to some java coding web sites.it is prerequest for me
Mysql Date Today
date in Mysql. Query for finding the current date:- mysql>... Mysql Date Today       Mysql Date Today show you Query to retrieve the current today date
Finding duplicates using array in for loop
Finding duplicates using array in for loop  how to find the duplicates in array using for loop
Java Date
provides the ability to get the current date and time. It also allows finding the day... The Java Date class allows the developers to manipulate date and time from within the Java program. The Java Date class is very useful
date
date   how to insert date in database? i need coding
Finding searching phrase of a search engine
Finding searching phrase of a search engine  how to find out searching phrase of a search engine..? like, if visitors enter the keyword to google, is is any possible to get that keyword
Finding Lost Frames - Java tutorial
Finding Lost Frames 2001-05-10 The Java Specialists' Newsletter [Issue 019] - Finding Lost Frames Author: Dr. Heinz M. Kabutz If you are reading... fact to the Politburo, but perhaps I've read too many spy stories. Finding
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  i want difference between the date entered in a jtextfield 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 Month
Mysql Date Month       Mysql Date Month is used to find out the value of current month. Understand with Example The Tutorial illustrate an example from 'Mysql Date Month
Finding smallest value, then the next etc
Finding smallest value, then the next etc  hi, I know how to search for the smallest value index in an unsorted array so far with this: double currentValue = dist[0]; int smallestIndex = 0; for (int j
Mysql Date Format Convert
you the current date and time Query for finding current date and time... Mysql Date Format Convert       You already Know with the Query to find the current date
Finding shapes in digital photos - java
Finding shapes in digital photos - java  Hello, I need some hints/tips regarding some project I'm doing. The project is about finding shapes in digital photos (JPEG file). Here's what I have to do: A digital photo
Mysql Date Last 30 Days
out the current date.   Query for finding the current date... | +-------------+ 1 row in set (0.00 sec) Query for finding the date which is 30... Mysql Date Last 30 Days      
Location finding error - JSP-Servlet
Location finding error  Location needs from drive name: My file uploading program has an error. It requires the location should be given from the directory name. Instead of this if only parent directory is given it shows
Mysql Date Minimum
(0.00 sec) Query for finding minimum date from the table:- The given... Mysql Date Minimum       Mysql Date Minimum return the minimum record value of a date field from
DATE
DATE  I have the following as my known parameter Effective 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
Mysql Date Previous Month
Mysql Date Previous Month       Mysql Date Previous Month is used to return the current and previous... a month (now( )) that return you current month value. Query for finding current month
Finding an ID Value and Print the Element Text
Finding an ID Value and Print the Element Text   ... for Finding an ID value in the code are described below :- Element root...:-RoseIndia Team  * Date:-10-Jun-2008  */ import 
Mysql Date Max
) Query for finding maximum date from the table:- The below Syntax... Mysql Date Max       Mysql Date return you the maximum rows or records value from a table. Understand
Finding memory consuming process - Java Beginners
Finding memory consuming process  Hi, While debugging or optimizing your java application, how to find the memory consuming processes? Thanks
Finding all palindrome prime numbers - Java Beginners
Finding all palindrome prime numbers  How do i write a program to Find all palindrome prime numbers between two integers supplied as input (start and end points are excluded
Mysql Date Manipulation
Mysql Date Manipulation       Mysql Date Manipulation find out the difference between two values... Date Manipulation. To grasp this example, we create a table 'Person' with field
date_isodate_setdate
from the first day of the week. Example: Finding the date from a week number...date_isodate_setdate The ISO Date Format PHP or DateTime::setISODate function sets the date according to ISO 8601 standard - using weeks and day offsets
i need a java code for finding typemismatch in an editor.
i need a java code for finding typemismatch in an editor.  hi im sriram, i need a java code in such a way that typemismatch code is embedded with the simple java editor. the sample output is shown below !alt text
servlet code for finding the table for given number
servlet code for finding the table for given number  servlet code for finding the table for given number?   Here is a an example that accepts a number from the user and display its multiplication table using servlet. 1
Finding the longest word in a user given string
Finding the longest word in a user given string  In java, accept a string from the user and find the longest word in it.   The given code finds the longest word from the string. import java.util.*; class LongestWord
HQL Date Between Example
we are finding the Invoice for some date rage. With the help of following HQL...HQL Date Between Example In this tutorial I will show you how you can use the HQL Date Between clause in Hibernate program. With the help of HQL between
Using JSTL For Finding Square
Using JSTL For Finding Square          In this program we are going... to finding out the square is the JSTL.  We are using the <c:forEach> core
Example for Finding the Root Element in the XML File
Example for Finding the Root Element in the XML File In this tutorial, we will discuss about how to find the Root Element in the XML file. The XML DOM views an XML document as a tree-structure. Contents can be updated or deleted. You
finding the eigenvalues and eigenvector of n*n matrix in java
finding the eigenvalues and eigenvector of n*n matrix in java  Here is my code: /** * Jacobi eigenvalue algorithm */ public class Jacobi { public static void main(String[] args) { double[][] A = new double
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 to display the next date of input date. This tutorial explains you all the steps
Finding start and end index of string using Regular expression
Finding start and end index of string using Regular expression... the way for finding start and end index of the string using regular expression. For this we are going to make program named Finding_index.java. The steps involved
Finding MAX value from emp_id column using SQL query?
Finding MAX value from emp_id column using SQL query?  I need to select maximum of the Emp_id values from SQL server 2005 table.I was using... please tell me SQL query for finding max value in Emp id column.Thanx. MY sql
date format - Date Calendar
date format  how to convert dd-mmm-yyyy date format to gregorian... to convert date to calender. import java.util.*; import java.text.*; public...="19-Sep-2008"; DateFormat format ; Date date ; format = new
finding the ip address of other system and store in the database - JDBC
finding the ip address of other system and store in the database  code to find the ip address,host name and their locale of other system that are connect to our system and store all these field or some of the fields

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.