• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSNumberFormatter & NSTimestamp -- Not Happening
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: String To BigDecimal - [SOLVED]
  • Previous by thread: Re: NSNumberFormatter & NSTimestamp -- Not Happening
  • Next by thread: Using Static HREF - Session Problems
  • Index(es):
    • Date
    • Thread