• 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: UTCDateTime????
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTCDateTime????


  • Subject: Re: UTCDateTime????
  • From: Brendan Younger <email@hidden>
  • Date: Mon, 6 Aug 2001 02:33:45 -0500

On Wednesday, August 1, 2001, at 06:59 PM, Rainer Brockerhoff wrote:

Date: Wed, 1 Aug 2001 13:11:54 -0500
From: Brendan Younger <email@hidden>

Sorry to beat this to death, but I just had to deal with this yesterday
and my particular solution is:

UTCDateTime UTCdate;
NSDate* date, *scratch;

scratch = [NSDate dateWithString:@"1904-01-01 00:00:00 +0000"];
date = [[NSDate alloc] initWithTimeInterval:UTCDate.lowSeconds
sinceDate:scratch];

This and Brian's will be obsolete in the next few decades. (Oh boy, Y2K
again!)

Good idea to use a reference interval - it certainly looks much more self-documenting. But, you create an extra object (and probably should autorelease it :-)).

On second thought, don't you get an hour-off error when dealing with daylight saving time? I think calling ConvertUTCToLocalDateTime compensates for that automatically.

...and doing the old union trick, as in my initial suggestion, means it _won't_ be obsolete any time soon (or even later).


--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
http://www.brockerhoff.net/ (updated July 2000)
This is really to anyone who knows, but what is the accepted practice for setting file modification dates? Should we just set them to whatever the local time is regardless of whether we're in daylight saving's time or what? I seem to remember a bug in OS 8 or so that caused backup utilities to think everything had been modified once daylight saving's time went into effect, so my first impression would be to leave it as is, anyone know?

Brendan Younger


References: 
 >Re: UTCDateTime???? (From: Rainer Brockerhoff <email@hidden>)

  • Prev by Date: Re: NSTimer fires ~0.0045 seconds early?
  • Next by Date: Re: Pop-Up Tabs and the Quest for a File Viewer
  • Previous by thread: Re: UTCDateTime????
  • Next by thread: Re: Suggestions?
  • Index(es):
    • Date
    • Thread