Re: Date calculation
Re: Date calculation
- Subject: Re: Date calculation
- From: "Sako!" <email@hidden>
- Date: Fri, 23 Apr 2004 17:45:09 +0200
try this
NSTimestamp timestamp = new NSTimestamp();
NSTimestamp newDate=
timestamp.timestampByAddingGregorianUnits(-1,0,0,0,0,0);
----- Original Message -----
From: "Randall Perry" <email@hidden>
To: <email@hidden>
Sent: Friday, April 23, 2004 3:54 PM
Subject: Date calculation
> Read through the archives to get tips on date calc. The consensus seems to
> be to convert NSTimestamp to GregorianCalendar to get accuracy.
>
> I need to find the date 1 year ago and tried this:
>
> NSTimestamp timestamp = new NSTimestamp();
> GregorianCalendar cal = new GregorianCalendar();
> cal.setTime(timestamp);
> cal.add( GregorianCalendar.DATE, -365);
> newtime = new NSTimestamp(cal.getTime());
>
>
> But get a compiler error on line 3: 'identifier expected'
>
> What's the problem?
>
>
> --
> 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.
_______________________________________________
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.