A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
java calneder example
Joined: Feb 17, 2009
Dec 22, 2011 07:48:39
I have situation where I need to calculate the dates as follows
how do i achieve this .
say for example if today's date is 12/21/2011
i want to get "Yesterday" as 12/20/2011( this is simple) using calender class
how to achieve the last WEEK 12/11/2011 to 12/17/2011
And as far as Last quarter concerned
Q1 - January, February, and March
Q2 - April, May, and June
Q3 - July, August, and September
Q4 - October, November, December
if today's date is 12/21/2011
then last quarter would be Q3 07/01/2011 to 09/30/2011.
How do i achieve this with
date or calender class or by any other means.
Thanks In Advance.
Joined: Jul 03, 2008
Dec 22, 2011 08:33:59
Caculate the 'days' of every month for the year
just use Calendar.add(-days)
Joined: Aug 05, 2005
Dec 22, 2011 09:16:35
You've already asked this question
I agree. Here's the link:
subject: java calneder example
Java date/calender help needed
How to store compile time data in Java
Help with select statements
Calender class and its components
Removing Z/z and time from Calender date
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013