class CFPropertyList::CFDate

geht the timestamp or the Apple timestamp
directly, you get the Time class. If you access via get_value you either
the rest of the world uses seconds since 1970. So if you access value
This class holds Time values. While Apple uses seconds since 2001,

def get_value(format=CFDate::TIMESTAMP_UNIX)

get timestamp, either UNIX or Apple timestamp
def get_value(format=CFDate::TIMESTAMP_UNIX)
  if(format == CFDate::TIMESTAMP_UNIX) then
    @value.to_i
  else
    @value.to_f - CFDate::DATE_DIFF_APPLE_UNIX
  end
end

def initialize(value = nil,format=CFDate::TIMESTAMP_UNIX)

set value to defined state
def initialize(value = nil,format=CFDate::TIMESTAMP_UNIX)
  if(value.is_a?(Time) || value.nil?) then
    @value = value.nil? ? Time.now : value
  elsif value.instance_of? Date
    @value = Time.utc(value.year, value.month, value.day, 0, 0, 0)
  elsif value.instance_of? DateTime
    @value = value.to_time.utc
  else
    set_value(value,format)
  end
end

def set_value(value,format=CFDate::TIMESTAMP_UNIX)

set value with timestamp, either Apple or UNIX
def set_value(value,format=CFDate::TIMESTAMP_UNIX)
  if(format == CFDate::TIMESTAMP_UNIX) then
    @value = Time.at(value)
  else
    @value = Time.at(value + CFDate::DATE_DIFF_APPLE_UNIX)
  end
end

def to_binary(bplist)

convert to binary
def to_binary(bplist)
  bplist.date_to_binary(@value)
end

def to_xml(parser)

convert to XML
def to_xml(parser)
  n = parser.new_node('date')
  n = parser.append_node(n, parser.new_text(CFDate::date_string(@value)))
  n
end