Home arrow static arrow Java Programming [Archive] - Operations with dates??
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Operations with dates??
This topic has 2 replies on 1 page.

Posts:24
Registered: 3/8/04
Operations with dates??  
Aug 3, 2004 6:59 PM



 
Hi.

I need to get the actual date in a variable and the next day in another variable.

D1 = 03/08/2004

D2= 03/08/2004

how can I do it??

thanks a lot!!

 

Posts:2,067
Registered: 5/3/01
Re: Operations with dates??  
Aug 3, 2004 7:06 PM (reply 1 of 2)



 
See:

new SimpleDateFormat("MM/dd/yy")
SimpleDateFormat.parse()
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

and

Calendar.getInstance()
Calendar.setTime()
Calendar.add()
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html

GregorianCalendar
http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html
 

Posts:24,036
Registered: 2/3/03
Re: Operations with dates??  
Aug 3, 2004 7:44 PM (reply 2 of 2)



 
[url=http://www.javaworld.com/jw-12-2000/jw-1229-dates.html]Calculating Java dates: Take the time to learn how to create and use dates[/url]

[url=http://www.javaalmanac.com/egs/java.text/FormatDate.html]Formatting a Date Using a Custom Format[/url]
[url=http://www.javaalmanac.com/egs/java.text/ParseDate.html]Parsing a Date Using a Custom Format[/url]
 
This topic has 2 replies on 1 page.