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

Re: Julian date


  • Subject: Re: Julian date
  • From: Fritz Anderson <email@hidden>
  • Date: Thu, 7 Jan 2010 12:56:01 -0600

On 7 Jan 2010, at 12:22 PM, Kyle Sluder wrote:

> There is no standalone Julian calendar in Cocoa. The only way to
> interpret dates relative to a Julian calendar is if they correspond to
> Gregorian dates prior to October 1582.

I believe the OP may be interested in the Julian _day_ (civil or astronomical — they differ by half a day), not the month/day/year on Julius Caesar's calendar. This is expressed as a floating point number representing days since an epoch roughly 2,451,545 days before January 1, 2000. The number is is used, for instance, to initialize DateTime objects in Ruby.

<http://en.wikipedia.org/wiki/Julian_day>

I worked the other way around, and slightly differently recently, from HFS creation dates to Julian day. I had to go through a couple of stages of indirection — UTCDateTime to CFAbsoluteTime, then division into days and offset for the difference between epochs (2451911 produced Ruby DateTimes corresponding to what the Finder displayed for those files). I got the epoch offset from the Core Foundation open source for CFDate. It's probably wrong for astronomical purposes, but it did the conversion correctly.

	— F

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Julian date (From: Alexander Cohen <email@hidden>)
 >Re: Julian date (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: NSPopupButton menu not showing in custom view for NSMenuItem
  • Next by Date: Re: iPhone: validate a NSString for US zipcode
  • Previous by thread: Re: Julian date
  • Next by thread: Re: Julian date
  • Index(es):
    • Date
    • Thread