Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: Adjusting a Date object in Visual Age for Java
|
Posted: Dec 3, 2002 11:39 AM
|
|
Here are a couple ideas:
- Change your computer's date back six months and run the program! ;-)
- Okay, this one is a little better: First, change every place where you have "new java.util.Date(); " to "getADate(); " (or whatever method name you prefer). This should be an easy search-and-replace operation with your editor, or sed, or whatever. In this new method, get the current date, modify it as necessary (or create another one based on it) and return the tweaked date.
If this needs to be done across classes, you may need a helper object to host the method and your original replacement above might be something along the lines of replacing "new java.util.Date(); " with "com.myfirm.utils.FakeDate.getInstance().getTweakedDate(); ".
|
|