|
-
February 24th, 2000, 02:19 PM
#1
Need help with Dates
I am trying to take the users input, parse it, and the do certain things based on the Julian date of the day given(Julian = day of year).
Date has been depreciated for Java2, but the parse() method for SimpleDateFormat(or DateFormat for that matter) still returns a Date type.
This works and is not a dire problem, but I hate getting those "GetDayOfYear.java uses or overrides a deprecated API. Recompile..."
Any ideas?
SimpleDateFormat std2yr = new SimpleDateFormat("MM/dd/yy");
SimpleDateFormat std4yr = new SimpleDateFormat("MM/dd/yyyy");
SimpleDateFormat txt2yr = new SimpleDateFormat("MMM-dd-yy");
SimpleDateFormat txt4yr = new SimpleDateFormat("MMM-dd-yyyy");
String atp = args[0];
Date d = new Date();
boolean SuccessfulParse = false;
try
{
d = std2yr.parse(atp);
SuccessfulParse = true;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|