Re: Date calculation
Re: Date calculation
- Subject: Re: Date calculation
- From: Randall Perry <email@hidden>
- Date: Fri, 23 Apr 2004 14:59:34 -0400
The code below works if I include the package:J)
import java.util.Calendar;
> Never mind. I had the code outside any function in a class file.
>
> Excuse me, I'm learning :-(
>
>> Again, with this code, on line 2 I get the error '<identifier expected>'. Am
>> I
>> missing a package or something?
>>
>>
>>> Calendar cal = Calendar.getInstance(); // cal is set to current date
>>> cal.add(Calendar.YEAR, -1); // subtracts 1 year from the calendar
>>> NSTimestamp oneYearAgo = new NSTimestamp(cal.getTimeInMillis());
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales
http://www.systame.com/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.