• 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: Dates (1-day resolution) redux
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dates (1-day resolution) redux


  • Subject: Re: Dates (1-day resolution) redux
  • From: Paul Hoadley <email@hidden>
  • Date: Wed, 11 Aug 2010 16:30:11 +0930

On 10/08/2010, at 11:44 PM, Simon wrote:

For dates like this, I force the time component to 12:00 noon.  That at least reduces the chance of timezone shifts of the day portion.

Chuck

same here:

public static NSTimestamp normalisedDate(NSTimestamp date) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(date);
int d = gc.get(GregorianCalendar.DAY_OF_MONTH);
int m = gc.get(GregorianCalendar.MONTH) + 1;
int y = gc.get(GregorianCalendar.YEAR);
NSTimeZone tz = NSTimeZone.systemTimeZone();
return new NSTimestamp(y, m, d, 12, 0, 0, tz);
} 

over 250 references to that method in our code base!

Thanks for all the input on this.  I think I'll try the approach above in the first instance.


-- 
Paul.

http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dates (1-day resolution) redux
      • From: Andrew Lindesay <email@hidden>
References: 
 >Dates (1-day resolution) redux (From: Paul Hoadley <email@hidden>)
 >Re: Dates (1-day resolution) redux (From: Chuck Hill <email@hidden>)
 >Re: Dates (1-day resolution) redux (From: Simon <email@hidden>)

  • Prev by Date: Re: Dates (1-day resolution) redux
  • Next by Date: Re: Dates (1-day resolution) redux
  • Previous by thread: Re: Dates (1-day resolution) redux
  • Next by thread: Re: Dates (1-day resolution) redux
  • Index(es):
    • Date
    • Thread