Re: Java date questions
Re: Java date questions
- Subject: Re: Java date questions
- From: Denis Stanton <email@hidden>
- Date: Thu, 30 Oct 2003 16:21:11 +1300
On Thursday, October 30, 2003, at 12:57 PM,
email@hidden wrote:
> [demime could not interpret encoding binary - treating as plain text]
> This isn't a WO question, it's more of a Java question, but I can't
> seem
> to figure it out anywhere.
>
> I have an NSTimestamp. I want to subtract seven days from it. If it's
> September 10, I want to end up with September 3. If it's September 1,
> I
> want to end up with October 25.
>
> I probably am gonna want to convert the NSTimestamp to a
> GregorianCalendar first. Fair enough. But I can't figure out what
> methods to call on the GregorianCalendar to do this date subtraction.
NSTimestamp today, lastWeek;
today = new NSTimeStamp();
lastWeek = today().timestampByAddingGregorianUnits(0, 0, -7, 0, 0, 0);
Denis Stanton
email@hidden
Home: (09) 533 0391
mobile: 021 1433622
_______________________________________________
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.