This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes java dates Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "java dates" Watch "java dates" New topic
Author

java dates

Jason Crest
Greenhorn

Joined: Oct 17, 2002
Posts: 29
im confused on how to get the current date in the format of YYYY-MM-DD and then get 4 days previous to that in same format

how to do that?

thx
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327


Anthony W.<br />MCP, SCJP 1.4, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
Jason Crest
Greenhorn

Joined: Oct 17, 2002
Posts: 29
works so good! much thanks!
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884


Using the GregorianCalendar class, you don't need to go into the mathematical calculations.

Hope this helps.


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: java dates
 
Similar Threads
encoding and decoding in java
IReports
Current time
pdf generation
Time stamp format