Re: NSNumberFormatter & NSTimestamp -- Not Happening
Re: NSNumberFormatter & NSTimestamp -- Not Happening
- Subject: Re: NSNumberFormatter & NSTimestamp -- Not Happening
- From: Denis Stanton <email@hidden>
- Date: Thu, 18 Sep 2003 18:50:46 +1200
Hi Jonathan
On Thursday, September 18, 2003, at 04:35 AM, Jonathan Rochkind wrote:
public static NSTimestamp setToZeroTime(NSTimestamp input) {
java.util.GregorianCalendar cal = new
java.util.GregorianCalendar();
cal.setTime(input);
cal.set( java.util.GregorianCalendar.HOUR_OF_DAY, 0);
cal.set( java.util.GregorianCalendar.MINUTE, 0);
cal.set( java.util.GregorianCalendar.SECOND, 0);
cal.set( java.util.GregorianCalendar.MILLISECOND, 0);
return new NSTimestamp( cal.getTime() );
}
Thank you. That's a more compact way of doing something I was doing
elsewhere in my code.
The original problem is solved by just throwing in an extra hour, which
later either brings the duration calculation up to a whole 24 hour
multiple or disappears in the rounding.
Denis
_______________________________________________
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.