On Sat, May 05, 2001 at 02:48:25PM -0400, srl wrote:
> On 5 May 2001, Rich Bowen wrote:
> > 1) A Date::Foo object will *always* have an internal
> > representaton as an ICal string, no matter what you provide it
> > when you create it.
> Hm. I'm not so sure about this, but I guess it's the only way to
> accomplish 2> and 3> elegantly. 

Do we want the internal representation to be a string?

glib's date format is:

struct GDate
{ 
  guint julian_days : 32; /* julian days representation - we use a
                           *  bitfield hoping that 64 bit platforms
                           *  will pack this whole struct in one big
                           *  int 
                           */

  guint julian : 1;    /* julian is valid */
  guint dmy    : 1;    /* dmy is valid */

  /* DMY representation */
  guint day    : 6;  
  guint month  : 4; 
  guint year   : 16; 
};


which fits nicely inside 64 bits so you can store it as a number in
databases and such. Maybe we can use something like this but with
time info included, and write some XS around it. That would make
it both more compact and probably faster.


Martijn

Reply via email to